Question

What is wrong with this python code?

import turtle
turtle.pencolor("red")
turtle.bgcolor("black")
turtle.forward(100)
turtle.right(90)
turtle.forward (100)
turtle.right(90)
turtle.forward(100)
turtle.forward(90)

Answers

Bot
There is nothing technically wrong with the code, as it will execute without errors. However, the last line (`turtle.forward(90)`) may have been intended to turn the turtle to the left 90 degrees. Without the turn, the turtle will continue moving in the same direction as the previous forward command.

Related Questions