0
0
Drone Programmingprogramming~10 mins

Pre-flight checklist automation in Drone Programming - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to initialize the checklist status as all items unchecked.

Drone Programming
checklist = {'battery': False, 'motors': False, 'gps': False, 'camera': False}
status = [1]
Drag options to blanks, or click blank then click option'
Achecklist
Bchecklist.copy()
Clist(checklist)
Ddict()
Attempts:
3 left
💡 Hint
Common Mistakes
Using list() converts keys to a list, not a dictionary.
Using dict() creates an empty dictionary, not a copy.
2fill in blank
medium

Complete the code to mark the 'battery' check as done.

Drone Programming
status['battery'] = [1]
Drag options to blanks, or click blank then click option'
A'done'
BTrue
C1
Dchecked
Attempts:
3 left
💡 Hint
Common Mistakes
Using strings instead of boolean values.
Using numbers instead of booleans.
3fill in blank
hard

Fix the error in the code that checks if all items are done.

Drone Programming
if all(status[1]):
    print('Ready for takeoff')
Drag options to blanks, or click blank then click option'
A[]
B.keys()
C.items()
D.values()
Attempts:
3 left
💡 Hint
Common Mistakes
Using keys() returns the item names, not their status.
Using items() returns pairs, which all() can't evaluate directly.
4fill in blank
hard

Fill both blanks to update the checklist for items starting with 'c'.

Drone Programming
for item in checklist:
    if item[1]'c'):
        status[item] = [2]
Drag options to blanks, or click blank then click option'
Astartswith(
Bendswith(
CTrue
DFalse
Attempts:
3 left
💡 Hint
Common Mistakes
Using endswith instead of startswith.
Setting status to False instead of True.
5fill in blank
hard

Fill all three blanks to create a dictionary of checked items only.

Drone Programming
checked_items = [1]: [2] for [3] in status.items() if [2] == True
Drag options to blanks, or click blank then click option'
A{k
Bv
Ck, v
D}
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting the curly braces.
Using wrong variable names.
Not filtering by True values.