Altitude Limits Configuration
📖 Scenario: You are programming a drone to fly safely within certain altitude limits. The drone must not fly below the minimum altitude or above the maximum altitude to avoid obstacles and legal restrictions.
🎯 Goal: Build a program that sets altitude limits, checks if a given altitude is within those limits, and prints whether the altitude is safe or not.
📋 What You'll Learn
Create a dictionary called
altitude_limits with keys 'min' and 'max' and values 100 and 500 respectively.Create a variable called
current_altitude and set it to 350.Write an
if statement that checks if current_altitude is between altitude_limits['min'] and altitude_limits['max'] inclusive.Print
"Altitude is within safe limits." if the altitude is safe, otherwise print "Altitude is out of safe limits!".💡 Why This Matters
🌍 Real World
Drones must fly within safe altitude limits to avoid collisions and comply with regulations.
💼 Career
Understanding how to configure and check limits is important for drone software developers and engineers working on autonomous flying devices.
Progress0 / 4 steps