Help, what's wrong in this code? | SoloLearn: Learn to code for FREE!

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

6/4/2017 9:12:04 AM

►► Ferontwix ◄◄

3 Answers

New Answer

+4

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

+3

indentation turtle.Turtle -> turtle.Turtle()

+2