Which of the following best describes what a drone (UAV) is?
Think about what UAV stands for and what it means to be 'unmanned'.
A drone, or UAV (Unmanned Aerial Vehicle), is an aircraft that flies without a human pilot onboard. It can be controlled remotely or fly autonomously using onboard computers.
What is the output of this Python code simulating a drone status check?
class Drone: def __init__(self, battery_level): self.battery_level = battery_level def check_status(self): if self.battery_level > 20: return "Ready to fly" else: return "Battery low" d = Drone(30) print(d.check_status())
Check the battery level value and the condition in the method.
The battery level is 30, which is greater than 20, so the method returns 'Ready to fly'.
What error does this code produce when run?
def fly(drone): if drone['status'] == 'ready': print('Drone is flying') else: print('Drone not ready') fly({'status': 'ready'})
Look carefully at the if-else syntax.
The else statement is missing a colon at the end, causing a SyntaxError.
Which of the following Python code snippets correctly defines a Drone class with a takeoff method that prints 'Taking off'?
Remember Python class and method syntax requires colons and indentation.
Option A correctly uses colons and indentation. Option A misses colon after class name. Option A misses self parameter. Option A has wrong indentation for print.
Given a list of drone mission durations in minutes, what is the total flight time?
missions = [15, 30, 45, 10]
Choose the correct Python code output.
missions = [15, 30, 45, 10] total_time = sum(missions) print(total_time)
Sum all numbers in the list.
The sum of 15 + 30 + 45 + 10 is 100, so the output is 100.
