- 1
Why isn’t my Turtle Python working
WHY IS IT? IT’S ALL VALID CODE ACCORDING TO geeksforgeeks.com.
5 Antworten
+ 6
nvd123
Sololearn doesn't support Graphics/some libraries so you need to use skulpt which is a JS framework. See here I have used.
https://code.sololearn.com/W6cmk391WqiN/?ref=app
+ 3
Steve is right: you cannot run script wich use GUI (and so is turtle) in sololearn...
the other way to make your code working (locally), would be to change 'from turtle import *' by 'import turtle' (and is better practice)
+ 2
When you do "from turtle import *" you import all the classes,methods and variables so no need to use turtle.Screen() ,
simply use Screen() .
from turtle import *
wn = Screen()
wn.bgcolor("light green")
wn.title("Turtle")
skk = Turtle()
skk.forward(100)
and tutorials from such type of websites won't explain everything.
+ 2
It's right there in the error message that it can't import Tk. I'm pretty sure I read somewhere else that Sololearn isn't configured for it.