Sail E0 Webinar
Question
What is the output of the following code?import turtlet=turtle.Pen()t.right(90)t.forward(100)t.heading()
Options:
A .  0.0
B .  90.0
C .  270.0
D .  360.0
Answer: Option C


The output of the code shown above will be 270.0. The function heading() returns the heading of the turtle, a value in degrees, counter-clockwise from the horizontal right. The output shape of this code is a straight line pointing downwards.



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers