Nov-16-2018, 05:57 PM
This bit of code is your problem:
for i in shape_list: if i.isCircle(): circle.draw() elif i.isRectangle(): rectangle.draw()You want to draw i, but you are drawing circle. The circle variable is rewritten every time you enter a new circle, and then appended to shape_list. Also note that both Circle and Rectangle objects have a draw method, so you don't need to figure out what type of shape it is to draw it. Try this instead:
for shape in shape_list: shape.draw()
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures