What will be the output of the following Python code? [code]import turtle t=turtle.Pen() t.goto(300,9) t.position()[/code]

Minh Phượng

New member
What will be the output of the following Python code?
Code:
import turtle
t=turtle.Pen()
t.goto(300,9)
t.position()
A. 300.00, 9.00
B. 9, 300
C. 300, 9
D. 9.00, 300.00
 
Answer: a
Explanation: The goto functions takes the arrow to the position specified by the user as arguments. The position function returns the current position of the arrow. Hence the output of the code shown above will be: 300.00, 9.00.
 

Tìm kiếm

Back
Top