0
0
Raspberry Piprogramming~10 mins

Why security protects deployed IoT devices in Raspberry Pi - Test Your Understanding

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

Complete the code to print a message confirming the device is secure.

Raspberry Pi
print("Device security status: [1]")
Drag options to blanks, or click blank then click option'
Aunknown
Bsecured
Coffline
Dvulnerable
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'vulnerable' or 'offline' which indicate insecurity or no connection.
2fill in blank
medium

Complete the code to check if the device is connected to a secure network.

Raspberry Pi
if network_status == '[1]':
    print("Network is secure")
Drag options to blanks, or click blank then click option'
Auntrusted
Bdisconnected
Csecure
Dunknown
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'disconnected' or 'untrusted' which do not mean secure.
3fill in blank
hard

Fix the error in the code that checks device authentication.

Raspberry Pi
if device.authenticated [1] True:
    print("Access granted")
Drag options to blanks, or click blank then click option'
A==
B=
C!=
D=>
Attempts:
3 left
💡 Hint
Common Mistakes
Using '=' instead of '==' causes syntax errors.
4fill in blank
hard

Fill both blanks to create a dictionary of device statuses for devices with battery level above 20.

Raspberry Pi
device_status = {device_id: status for device_id, status in devices.items() if status['[1]'] > 20 and status['[2]'] == 'active'}
Drag options to blanks, or click blank then click option'
Abattery_level
Bsignal_strength
Cstatus
Ddevice_id
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'signal_strength' or 'device_id' in conditions which are incorrect.
5fill in blank
hard

Fill all three blanks to create a dictionary of device names in uppercase for devices with signal above 50 and status 'online'.

Raspberry Pi
device_names = { [1]: [2].upper() for [3], info in devices.items() if info['signal'] > 50 and info['status'] == 'online'}
Drag options to blanks, or click blank then click option'
Aname.upper()
Binfo['name']
Cdevice_id
Dname
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up keys and values or using wrong variable names.