They are both polyhedra with a polygonal base. The difference is that a prism has another, identical polygonal face and this is joined to the base by a number of parallelograms (usually rectangles in high school maths). A pyramid has a single point, called the apex , which is connected to the base by a set of triangular faces.
If the polygonal shape has n sides,
the prism has n+2 faces, 3n edges and 2n vertices
the pyramid has n+1 faces, 2n edges and n+1 vertices.
A pyramid has one base, a prism has two.A pyramid has one base, a prism has two.A pyramid has one base, a prism has two.A pyramid has one base, a prism has two.
The base of a triangular prism is a triangle and the base of a square pyramid is a square.
A prism is defined as a solid (or three dimensional) geometrical shape in which the sides are parallel, whereas in a pyramid the sides are not parallel and they all come together in an apex.
rectangle triangle there is a difference
rectangular prism has 8 vertices. rectangular pyramid has 5 vertices. Difference is 3.