0
0
Drone Programmingprogramming~20 mins

goto() command for navigation in Drone Programming - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Master of goto() Navigation
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
Output of goto() with simple coordinates
What will be the output of this drone navigation code snippet?
Drone Programming
drone.goto(10, 20, 5)
print(drone.position())
A(10, 20)
B(0, 0, 0)
C(10, 20, 5)
DError: Invalid coordinates
Attempts:
2 left
💡 Hint
The goto() command moves the drone to the specified x, y, z coordinates.
Predict Output
intermediate
2:00remaining
Effect of sequential goto() commands
What will be the drone's final position after running this code?
Drone Programming
drone.goto(5, 5, 5)
drone.goto(10, 0, 0)
print(drone.position())
A(5, 5, 5)
B(0, 0, 0)
C(15, 5, 5)
D(10, 0, 0)
Attempts:
2 left
💡 Hint
Each goto() command moves the drone to a new absolute position.
🔧 Debug
advanced
2:00remaining
Identify the error in goto() usage
This code is intended to move the drone to (10, 10, 10). What error will it cause?
Drone Programming
drone.goto(10, 10)
print(drone.position())
ATypeError: missing 1 required positional argument 'z'
BSyntaxError: invalid syntax
CValueError: coordinates must be positive
DNo error, outputs (10, 10, 0)
Attempts:
2 left
💡 Hint
The goto() command requires three coordinates: x, y, and z.
🧠 Conceptual
advanced
2:00remaining
Understanding relative vs absolute goto()
Which statement correctly describes the difference between absolute and relative goto() commands?
AAbsolute goto() moves the drone by offsets; relative goto() moves it to exact coordinates.
BAbsolute goto() moves the drone to exact coordinates; relative goto() moves it by offsets from current position.
CBoth absolute and relative goto() move the drone to exact coordinates but use different units.
DRelative goto() moves the drone to the origin; absolute goto() moves it randomly.
Attempts:
2 left
💡 Hint
Think about whether the drone moves to a fixed point or moves relative to where it is now.
Predict Output
expert
3:00remaining
Output after complex navigation sequence
What is the final position printed by this code?
Drone Programming
drone.goto(0, 0, 0)
drone.goto(5, 5, 5)
drone.goto(5, 10, 5)
drone.goto(10, 10, 10)
print(drone.position())
A(10, 10, 10)
B(5, 10, 5)
C(0, 0, 0)
D(15, 25, 20)
Attempts:
2 left
💡 Hint
Each goto() sets the drone's position absolutely, not cumulatively.