0
0
Drone Programmingprogramming~20 mins

Inspection of infrastructure in Drone Programming - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Infrastructure Inspection Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
Drone Path Calculation Output
What is the output of the following drone path calculation code snippet?
Drone Programming
path = [(0,0), (1,2), (3,5), (6,8)]
total_distance = 0
for i in range(len(path)-1):
    x1, y1 = path[i]
    x2, y2 = path[i+1]
    dist = ((x2 - x1)**2 + (y2 - y1)**2)**0.5
    total_distance += dist
print(round(total_distance, 2))
A10.08
B10.0
C12.0
D9.5
Attempts:
2 left
💡 Hint
Calculate the distance between each consecutive point and sum them.
🧠 Conceptual
intermediate
1:30remaining
Understanding Drone Sensor Data Processing
Which option best describes how a drone processes sensor data to detect structural cracks during inspection?
AThe drone uses image recognition algorithms to analyze photos taken and identify crack patterns.
BThe drone uses sound waves to detect cracks without any image data.
CThe drone ignores sensor data and relies on GPS coordinates only.
DThe drone manually inspects cracks by sending a technician to the site.
Attempts:
2 left
💡 Hint
Think about how drones use cameras and software to analyze structures.
🔧 Debug
advanced
1:30remaining
Fix the Drone Battery Check Logic
What error does the following drone battery check code raise when executed?
Drone Programming
battery_level = 15
if battery_level < 20
    print("Battery too low for inspection flight.")
else:
    print("Battery level sufficient.")
ATypeError because battery_level is not an integer
BNo error, prints 'Battery too low for inspection flight.'
CNameError because battery_level is undefined
DSyntaxError due to missing colon after if statement
Attempts:
2 left
💡 Hint
Check the syntax of the if statement.
📝 Syntax
advanced
1:30remaining
Identify the Correct Drone Command Syntax
Which option shows the correct syntax to command a drone to hover at 10 meters altitude for 5 seconds?
Adrone.hover(altitude:10, duration:5)
Bdrone.hover(10, 5 seconds)
Cdrone.hover(altitude=10, duration=5)
Ddrone.hover(altitude=10 duration=5)
Attempts:
2 left
💡 Hint
Look for proper function call syntax with named parameters.
🚀 Application
expert
2:30remaining
Calculate Number of Inspection Points
A drone inspects a bridge by taking photos every 3 meters along a 120-meter span. It also takes 2 photos at each end for detailed views. How many photos does the drone take in total?
A40
B42
C44
D46
Attempts:
2 left
💡 Hint
Divide the span by the photo interval, then add the extra photos at the ends.