Nov-16-2018, 07:18 PM
(This post was last modified: Nov-16-2018, 07:19 PM by itmustbebunnies.)
I must've misunderstood what you were telling me before, buran. I thought that testing the object type, somehow, using isCircle/isRectangle would solve my issue? I have removed it from both classes and removed the kind property, as well.
Also, I've changed
I also made a few minor tweaks (e.g. resetting the turtle screen each time user selects draw) and the code is now working as intended! Yay! Thank you both for being so helpful (and thank you for explaining to me the reason for the issues with the way my code was written, too). Admittedly, I am an "older" student and worried that this (coding) might be beyond my grasp but I've found this forum (I've received assistance from both of you before) to be a major help.
Also, I've changed
for i in shape_list: if i.isCircle(): circle.draw() elif i.isRectangle(): rectangle.draw()to
for shape in shape_list: shape.draw()as ichabod801 pointed out.
I also made a few minor tweaks (e.g. resetting the turtle screen each time user selects draw) and the code is now working as intended! Yay! Thank you both for being so helpful (and thank you for explaining to me the reason for the issues with the way my code was written, too). Admittedly, I am an "older" student and worried that this (coding) might be beyond my grasp but I've found this forum (I've received assistance from both of you before) to be a major help.