- 1

Why isn’t my Turtle Python working

WHY IS IT? IT’S ALL VALID CODE ACCORDING TO geeksforgeeks.com.

8th Mar 2021, 4:28 PM
nvd123
nvd123 - avatar
5 Respostas
+ 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
8th Mar 2021, 5:31 PM
A͢J
A͢J - avatar
+ 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)
8th Mar 2021, 5:03 PM
visph
visph - avatar
+ 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.
8th Mar 2021, 4:37 PM
Abhay
Abhay - avatar
+ 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.
8th Mar 2021, 4:41 PM
Steve
Steve - avatar