📊 Your Progress
Track your learning journey:
Quizzes Completed: 0 / 20
Challenges Completed: 0 / 3
🎯 Interactive Quizzes
Test your knowledge with interactive multiple-choice questions. Select your answer and get instant feedback!
Quiz 1: Basic Drone Functions
What is the first function you should call after creating a Drone object?
Quiz 2: Sensor Functions
Which function gets the distance from the front range sensor?
Quiz 3: Movement Functions
What does the hover() function do?
Quiz 4: Safety Best Practices
What is the minimum battery percentage you should check before takeoff?
Quiz 5: Error Handling
What should you always include in a try-except block when working with drones?
Quiz 6: Flight Patterns
Which function makes the drone fly in a square pattern?
Quiz 7: Color Sensors
What does get_front_color() return?
Quiz 8: Battery Management
What function should you call to check battery level before flight?
Quiz 9: Movement Commands
What is the difference between go() and move_distance()?
Quiz 10: Cleanup
What function should you always call at the end of your program?
🐍 Python Programming Quizzes
Test your Python programming knowledge with these interactive questions!
Quiz 11: Python Basics
What is the output of: print(2 + 3 * 4)?
Quiz 12: Variables and Assignment
What is the difference between = and == in Python?
Quiz 13: Lists
How do you add an item to the end of a list?
Quiz 14: Loops
What does range(5) return?
Quiz 15: Functions
How do you define a function in Python?
Quiz 16: Dictionaries
How do you access a value in a dictionary?
Quiz 17: String Methods
What does "Hello".upper() return?
Quiz 18: Conditionals
What is the correct syntax for an if statement?
Quiz 19: Error Handling
What keyword is used to handle errors in Python?
Quiz 20: List Comprehensions
What does [x*2 for x in range(3)] return?
💻 Code Challenges
Write code to solve these challenges. Test your solutions and get hints if you need help!
Challenge 1: Safe Takeoff Function
Write a function that checks the battery level before taking off. The function should:
- Check if battery is above 30%
- If yes, take off and hover for 2 seconds
- If no, print a warning message
Challenge 2: Obstacle Detection
Write a function that makes the drone move forward until it detects an obstacle within 50cm:
- Use a while loop
- Check front range sensor continuously
- Stop when obstacle is detected
Challenge 3: Square Flight Pattern
Write code to make the drone fly in a square pattern:
- Take off and hover
- Move forward, turn right, repeat 4 times
- Land safely
📖 Step-by-Step Tutorials
Follow these interactive tutorials to learn step by step!
Before programming, you need to understand the basic components:
- Drone object: Represents your physical drone
- Pairing: Establishes connection between code and drone
- Safety checks: Always check battery before flight
Let's write your first flight program:
from codrone_edu.drone import *
drone = Drone()
drone.pair()
drone.takeoff()
drone.hover(2)
drone.land()
drone.close()
This program pairs, takes off, hovers for 2 seconds, then lands.
Always add safety checks before flight:
battery = drone.get_battery()
if battery > 30:
drone.takeoff()
# Your flight code
drone.land()
else:
print("Battery too low!")
Sensors help your drone understand its environment:
- Front range sensor: Measures distance to obstacles
- Color sensor: Detects colors
- Gyroscope: Measures rotation
distance = drone.get_front_range()
if distance < 50:
print("Obstacle detected!")