Below is Python code you can use to draw a square. NOTE: When you save the file, do not call it 'turtle' or Python will try to import the script into itself and give an error because your script does not have the necessary commands.
import turtle
pen=turtle.Turtle()
pen.forward(100)
pen.right(90)
pen.forward(100)
pen.right(90)
pen.forward(100)
pen.right(90)
pen.forward(100)
pen.right(90)
NOTE: If you get an error, check for these common mistakes:
This lesson is part of the Simple Python Challenges Course