Issue
This is my code :
import turtle
wn = turtle.Screen()
alex = turtle.Turtle()
alex.forward(50)
alex.left(90)
alex.forward(30)
wn.mainloop()
And my error is: "_Screen object has no attribute mainloop"
I tried to do just "mainloop" but then I got NameError while doing alex.mainloop gave same error i.e. turtle object has no attribute mainloop.
Googling told me that I might have my file name as turtle.py creating the conflict but that's not the case.
Solution
You just need to call the mainloop()
function on the turtle
module. So your last line should be:
turtle.mainloop()
Answered By - krock
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.