0
0
Drone Programmingprogramming~30 mins

Why drones solve real industry problems in Drone Programming - See It in Action

Choose your learning style9 modes available
Why drones solve real industry problems
📖 Scenario: Imagine you work for a company that uses drones to help farmers check their fields. Drones can fly over large areas quickly and collect important information like plant health and soil condition.
🎯 Goal: You will create a simple program that stores data about different fields and their health scores, then find which fields need attention based on a health threshold.
📋 What You'll Learn
Create a dictionary called fields with exact field names and health scores
Create a variable called health_threshold with the value 70
Use a dictionary comprehension to create a new dictionary fields_needing_attention with fields having health below the threshold
Print the fields_needing_attention dictionary
💡 Why This Matters
🌍 Real World
Drones help farmers by quickly checking large fields and identifying areas that need care, saving time and resources.
💼 Career
Understanding how to process and filter data collected by drones is useful for jobs in agriculture technology, environmental monitoring, and drone software development.
Progress0 / 4 steps
1
DATA SETUP: Create the fields data
Create a dictionary called fields with these exact entries: 'FieldA': 85, 'FieldB': 65, 'FieldC': 90, 'FieldD': 55
Drone Programming
Need a hint?

Use curly braces {} to create a dictionary with field names as keys and health scores as values.

2
CONFIGURATION: Set the health threshold
Create a variable called health_threshold and set it to 70
Drone Programming
Need a hint?

Just assign the number 70 to the variable health_threshold.

3
CORE LOGIC: Find fields needing attention
Use a dictionary comprehension to create a new dictionary called fields_needing_attention that includes only fields from fields with health scores less than health_threshold
Drone Programming
Need a hint?

Use {field: health for field, health in fields.items() if health < health_threshold} to filter the dictionary.

4
OUTPUT: Show fields needing attention
Write a print statement to display the fields_needing_attention dictionary
Drone Programming
Need a hint?

Use print(fields_needing_attention) to show the result.