Complete the code to print a message on the Raspberry Pi console.
print([1])
The print() function requires the message to be inside quotes to print it as text.
Complete the code to read input from the user on Raspberry Pi.
user_name = [1]("Enter your name: ")
The input() function reads text typed by the user.
Fix the error in the code to blink an LED connected to GPIO pin 17.
import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO.setup(17, GPIO.OUT) GPIO.output(17, [1]) time.sleep(1) GPIO.output(17, GPIO.LOW)
GPIO pins are set HIGH or LOW to turn on or off. Use GPIO.HIGH to turn the LED on.
Fill both blanks to create a dictionary of sensor readings where keys are sensor names and values are readings above 50.
sensor_data = { [1]: [2] for [1] in sensors if sensors[[1]] > 50 }Use the loop variable sensor as key and sensors[sensor] as value for readings above 50.
Fill all three blanks to create a dictionary of uppercase sensor names mapped to their readings if readings are above 30.
filtered = { [1]: [2] for [3] in sensors if sensors[[3]] > 30 }Use sensor.upper() as key, sensors[sensor] as value, and sensor as loop variable.