Challenge - 5 Problems
Telemetry Data Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
Output of telemetry data parsing
What is the output of this code that parses telemetry data from a drone?
Drone Programming
telemetry = {'altitude': 1200, 'speed': 45, 'battery': 78}
status = f"Altitude: {telemetry['altitude']}m, Speed: {telemetry['speed']}km/h, Battery: {telemetry['battery']}%"
print(status)Attempts:
2 left
💡 Hint
Look carefully at the formatting in the f-string and the values accessed from the dictionary.
✗ Incorrect
The code uses an f-string to format the telemetry dictionary values with units and percentage signs. Option C matches the exact output.
🧠 Conceptual
intermediate1:30remaining
Understanding telemetry data update frequency
If a drone sends telemetry data every 500 milliseconds, how many telemetry updates will be received in 5 seconds?
Attempts:
2 left
💡 Hint
Calculate how many 500ms intervals fit into 5 seconds.
✗ Incorrect
5 seconds = 5000 milliseconds. 5000 / 500 = 10 intervals. But each interval sends one update, so 10 updates.
🔧 Debug
advanced2:00remaining
Identify the error in telemetry data extraction
What error does this code raise when trying to access telemetry data?
Drone Programming
telemetry = {'altitude': 300, 'speed': 60}
print(telemetry['battery'])Attempts:
2 left
💡 Hint
Check if the key 'battery' exists in the dictionary.
✗ Incorrect
The dictionary does not have the key 'battery', so accessing it raises a KeyError.
📝 Syntax
advanced1:30remaining
Syntax error in telemetry data processing
Which option contains the correct syntax to update the battery level in the telemetry dictionary?
Drone Programming
telemetry = {'altitude': 500, 'speed': 30, 'battery': 90}Attempts:
2 left
💡 Hint
Remember how to update dictionary values in Python.
✗ Incorrect
Option D uses the correct syntax to update a dictionary key's value. Other options are invalid syntax in Python.
🚀 Application
expert2:30remaining
Calculate average speed from telemetry data list
Given a list of telemetry speed readings, which option correctly calculates the average speed?
Drone Programming
speeds = [40, 45, 50, 55, 60]
Attempts:
2 left
💡 Hint
Average speed is total speed divided by number of readings.
✗ Incorrect
Option B correctly calculates the average by dividing the sum of speeds by the count. Option B does integer division, which may lose precision. Options C and D do not calculate average.