Bird
0
0
Raspberry Piprogramming~10 mins

Why displays provide visual feedback 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 on the display.

Raspberry Pi
print([1])
Drag options to blanks, or click blank then click option'
Aprint
BHello, World!
C"Hello, World!"
Ddisplay
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting the quotes around the text.
Trying to print a variable that is not defined.
2fill in blank
medium

Complete the code to clear the display before showing new text.

Raspberry Pi
display.[1]()
Drag options to blanks, or click blank then click option'
Aclear
Bshow
Cprint
Dupdate
Attempts:
3 left
💡 Hint
Common Mistakes
Using show() instead of clear().
Trying to print without clearing old text.
3fill in blank
hard

Fix the error in the code to update the display with new text.

Raspberry Pi
display.[1]("New message")
Drag options to blanks, or click blank then click option'
Ashow
Bprint
Cclear
Dupdate
Attempts:
3 left
💡 Hint
Common Mistakes
Using print() which does not update the display hardware.
Using clear() which erases content instead of showing it.
4fill in blank
hard

Fill both blanks to create a dictionary showing word lengths only for words longer than 3 letters.

Raspberry Pi
lengths = {word: [1] for word in words if len(word) [2] 3}
Drag options to blanks, or click blank then click option'
Alen(word)
B<
C>
Dword
Attempts:
3 left
💡 Hint
Common Mistakes
Using word instead of len(word) for the value.
Using < instead of > in the condition.
5fill in blank
hard

Fill all three blanks to create a dictionary with uppercase keys and values greater than zero.

Raspberry Pi
result = { [1]: [2] for k, v in data.items() if v [3] 0 }
Drag options to blanks, or click blank then click option'
Ak.upper()
Bv
C>
Dk
Attempts:
3 left
💡 Hint
Common Mistakes
Using k instead of k.upper() for keys.
Using < or == instead of > in the condition.