Why simulation prevents costly crashes
📖 Scenario: You are working on programming a drone to fly safely. Before flying the real drone, you want to test its behavior in a simulation to avoid crashes that could damage the drone or cause accidents.
🎯 Goal: Build a simple simulation that checks if the drone's speed is safe before flying. If the speed is too high, the simulation warns you to slow down, preventing a costly crash.
📋 What You'll Learn
Create a variable called
drone_speeds with exact speeds for three test flights: 5, 15, and 25Create a variable called
max_safe_speed set to 20Use a
for loop with variable speed to check each speed in drone_speedsInside the loop, use an
if statement to print "Safe speed: {speed}" if speed is less than or equal to max_safe_speedOtherwise, print
"Warning! Speed {speed} too high! Slow down."Print the results exactly as specified
💡 Why This Matters
🌍 Real World
Simulating drone flight speeds helps engineers test safety before flying real drones, saving money and preventing accidents.
💼 Career
Drone programmers and engineers use simulations to ensure drones operate safely under different conditions.
Progress0 / 4 steps