0
0
Drone Programmingprogramming~30 mins

Agricultural spraying and monitoring in Drone Programming - Mini Project: Build & Apply

Choose your learning style9 modes available
Agricultural spraying and monitoring
📖 Scenario: You are programming a drone to help farmers spray pesticides and monitor crop health efficiently. The drone needs to know which fields to spray, the amount of pesticide to use, and then report the spraying status for each field.
🎯 Goal: Build a simple program that stores field data, sets a spraying threshold, calculates which fields need spraying based on crop health, and then outputs the spraying plan.
📋 What You'll Learn
Create a dictionary with field names and their crop health scores
Add a spraying threshold variable to decide which fields need spraying
Use a loop or comprehension to select fields below the threshold
Print the list of fields that require spraying
💡 Why This Matters
🌍 Real World
Farmers use drones to spray pesticides only where needed, saving chemicals and protecting the environment.
💼 Career
DevOps engineers working with agricultural drones need to write and maintain code that controls drone operations and data processing.
Progress0 / 4 steps
1
Create field health data
Create a dictionary called fields_health with these exact entries: 'Field1': 75, 'Field2': 60, 'Field3': 85, 'Field4': 55, 'Field5': 90
Drone Programming
Need a hint?

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

2
Set spraying threshold
Create a variable called spray_threshold and set it to 70 to decide which fields need spraying
Drone Programming
Need a hint?

Just assign the number 70 to the variable spray_threshold.

3
Select fields to spray
Create a list called fields_to_spray that contains the names of fields from fields_health where the health score is less than spray_threshold using a list comprehension
Drone Programming
Need a hint?

Use a list comprehension to check each field's health and include it if below spray_threshold.

4
Print spraying plan
Write a print statement to display the list fields_to_spray exactly as it is
Drone Programming
Need a hint?

Use print(fields_to_spray) to show the fields that need spraying.