Complete the code to set the maximum allowed drone weight as per DGCA rules.
max_weight_kg = [1]The DGCA allows drones up to 500 kg in the 'Nano' to 'Large' categories. Here, 500 kg is the upper limit for certain drone classes.
Complete the code to check if drone registration is required based on weight.
requires_registration = drone_weight_kg [1] 250
Drones weighing 250 grams or more must be registered with DGCA.
Fix the error in the code that checks if drone flight is allowed in restricted zones.
if flight_zone == 'restricted' and drone_category [1] 'Nano': allow_flight = False
Flight is not allowed in restricted zones unless the drone is a Nano category (which is allowed). So we check if drone_category is not 'Nano'.
Fill both blanks to create a dictionary comprehension that maps drone categories to their max weight limits if the weight is less than 500 kg.
weight_limits = {category: [1] for category, weight in drone_data.items() if weight [2] 500}The comprehension maps categories to their weights only if the weight is less than 500 kg.
Fill all three blanks to create a filtered dictionary of drones with registration required and weight over 250 grams.
registered_drones = { [1]: [2] for [3], [2] in drones.items() if [2] >= 250 }The dictionary keys are drone IDs and values are weights. We iterate over drone_id and weight pairs, filtering weights >= 250 grams.