+ 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)

4th Jun 2017, 9:12 AM
â–șâ–ș Ferontwix ◄◄
â–șâ–ș Ferontwix ◄◄ - avatar
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 ^^ )
4th Jun 2017, 11:17 AM
visph
visph - avatar
+ 4
indentation turtle.Turtle -> turtle.Turtle()
4th Jun 2017, 9:36 AM
Álvaro
+ 2
thanks
4th Jun 2017, 9:43 AM
â–șâ–ș Ferontwix ◄◄
â–șâ–ș Ferontwix ◄◄ - avatar