+ 2
Help, what's wrong in this code?
import turtle my_turtle = turtle.Turtle def square(angle,leght): my_turtle.forward(leght) my_turtle.left(angle) my_turtle.forward(leght) my_turtle.left(angle) my_turtle.forward(leght) my_turtle.left(angle) my_turtle.forward(leght) square(90,200)
3 RĂ©ponses
+ 5
As tell by @Ălvaro, you need indent all code lines defining your square() custom function... but anyway, if you try to run this code in Sololearn code playground, you will not succeed, as module Turtle is not available/runnable in this context ( Python interpreter is running on server side, in a kind of emulator limited to text console mode and not compatible with any graphic mode ^^ )
+ 4
indentation
turtle.Turtle -> turtle.Turtle()
+ 2
thanks