0
0
Drone Programmingprogramming~20 mins

Indian drone regulations (DGCA rules) in Drone Programming - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
DGCA Drone Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
Output of Drone Flight Authorization Check
What is the output of this code that checks if a drone flight is authorized based on altitude and no-fly zone?
Drone Programming
def check_authorization(altitude, in_no_fly_zone):
    if altitude > 400:
        return "Flight not authorized: altitude too high"
    if in_no_fly_zone:
        return "Flight not authorized: no-fly zone"
    return "Flight authorized"

print(check_authorization(350, False))
A"Flight not authorized: altitude too high"
B"Flight authorized"
C"Flight not authorized: no-fly zone"
D"Flight authorized with restrictions"
Attempts:
2 left
💡 Hint
Check the altitude and no-fly zone conditions carefully.
🧠 Conceptual
intermediate
1:30remaining
Understanding Drone Weight Categories
According to DGCA rules, which weight category does a drone weighing 3.5 kg belong to?
ANano drone (less than 250 grams)
BMicro drone (250 grams to 2 kg)
CSmall drone (2 kg to 25 kg)
DMedium drone (25 kg to 150 kg)
Attempts:
2 left
💡 Hint
Check the weight ranges for each category carefully.
🔧 Debug
advanced
2:00remaining
Identify the Error in Geo-fencing Code
What error does this code raise when checking if a drone is inside a geo-fenced area?
Drone Programming
def is_inside_geo_fence(lat, lon, fence):
    return fence['lat_min'] <= lat <= fence['lat_max'] and fence['lon_min'] <= lon <= fence['lon_max']

fence = {'lat_min': 12.0, 'lat_max': 13.0, 'lon_min': 77.0}
print(is_inside_geo_fence(12.5, 77.5, fence))
AKeyError: 'lon_max'
BTypeError: unsupported operand type(s) for <=: 'dict' and 'float'
CReturns False
DSyntaxError: invalid syntax
Attempts:
2 left
💡 Hint
Check if all required keys exist in the fence dictionary.
📝 Syntax
advanced
1:30remaining
Syntax Error in Drone Flight Plan Dictionary
Which option contains the correct syntax for defining a drone flight plan dictionary with keys 'start', 'end', and 'altitude'?
Aflight_plan = {'start': (12.9716, 77.5946), 'end': (13.0358, 77.5970), 'altitude': 300}
Bflight_plan = {'start': (12.9716, 77.5946), 'end': (13.0358, 77.5970) 'altitude': 300}
Cflight_plan = {'start': (12.9716, 77.5946), 'end': (13.0358, 77.5970), 'altitude': 300,}
Dflight_plan = {'start': (12.9716, 77.5946), 'end': (13.0358, 77.5970), altitude: 300}
Attempts:
2 left
💡 Hint
Check commas and quotes around keys.
🚀 Application
expert
2:30remaining
Calculate Total Flight Time with Battery Constraints
Given a drone with a battery capacity of 6000 mAh and a consumption rate of 1200 mAh per 10 minutes, what is the maximum flight time in minutes?
A50 minutes
B60 minutes
C70 minutes
D80 minutes
Attempts:
2 left
💡 Hint
Divide battery capacity by consumption rate per minute.