Complete the code to define a drone's basic takeoff function.
def takeoff(): print("Drone is [1]")
The function prints that the drone is taking off, which is the correct action for a takeoff function.
Complete the code to check if the drone's battery level is sufficient for flight.
if battery_level [1] 20: print("Battery low, please recharge.")
The code checks if the battery level is less than or equal to 20 to warn about low battery.
Fix the error in the drone's altitude adjustment code.
altitude [1] 5
The '+=' operator correctly increases the altitude by 5 units.
Fill both blanks to create a dictionary of drone models and their max flight times.
flight_times = {"ModelA": [1], "ModelB": [2]The dictionary maps ModelA to 30 minutes and ModelB to 45 minutes of max flight time.
Fill all three blanks to filter drones with battery life greater than 40 and create a new dictionary.
filtered_drones = [1]: [2] for [3], [2] in drones.items() if [2] > 40}
The code creates a dictionary with model names as keys and battery values as values, filtering those with battery > 40.