1
QuizMultiple Choice

Use Data Structures — Cumulative exam

Question 1 • Introduction to Information Technology - EL3701

Kali, a Python programmer, is using the turtle module to write the word “hello.” Which code should she use to indicate the location to begin writing the word?

Answer
A
# Pick up the turtle and move it to its starting location.
B
penup(-100, 200) goto()pendown()
C
penup() goto(-100, 200) pendown()
D
# Pick up the turtle and move it to (-100, 200)

Explanation

In Python’s turtle module, use penup() to move without drawing, goto(x, y) to move to the chosen coordinates, and pendown() to begin drawing again. Choice C uses these commands in the correct order and moves the turtle to (-100, 200). Choice B puts the coordinates in penup(), which does not accept them.

AI-written and checked against the verified answer.

Next