Introduction
Flying a drone safely means making sure it doesn't go too high or too low. Setting altitude limits helps prevent accidents and keeps the drone within legal and safe boundaries.
Imagine a child playing with a remote-controlled toy car inside a fenced yard. The fence keeps the car from going into the street or neighbors' yards, just like altitude limits keep a drone within safe heights.
┌───────────────────────────────┐
│ Maximum Altitude │
│ (Ceiling) │
└──────────────┬────────────────┘
│
│
┌──────────┴──────────┐
│ │
│ Drone Flight │
│ Zone │
└──────────┬──────────┘
│
┌──────────────┴───────────────┐
│ Minimum Altitude │
│ (Floor) │
└───────────────────────────────┘setAltitudeLimits(min, max) in drone programming?setAltitudeLimits(min, max) clearly suggests setting limits related to altitude using minimum and maximum values.setAltitudeLimits(50, 200); print(getAltitudeLimits());
getAltitudeLimits() returns the current limits as a list [min, max].setAltitudeLimits(50, 200) sets the limits to minimum 50 and maximum 200. getAltitudeLimits() returns the current limits as a list [min, max].setAltitudeLimits(150, 100); print(getAltitudeLimits());
setAltitudeLimits(min, max) requires min < max.setAltitudeLimits(150, 100) where min=150 and max=100, which violates the rule min < max.Pass the test and this pattern moves unknown