0
0
Intro to Computingfundamentals~10 mins

Input devices (keyboard, mouse, touchscreen) in Intro to Computing - Interactive Code Practice

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

Complete the code to print the name of an input device.

Intro to Computing
device = '[1]'
print(device)
Drag options to blanks, or click blank then click option'
Akeyboard
Bprinter
Cmonitor
Dspeaker
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing output devices like monitor or speaker instead of input devices.
2fill in blank
medium

Complete the code to check if the input device is a mouse.

Intro to Computing
if device == '[1]':
    print('This is a pointing device')
Drag options to blanks, or click blank then click option'
Amouse
Bprinter
Ctouchscreen
Dkeyboard
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing touchscreen with mouse.
Using output devices like printer.
3fill in blank
hard

Fix the error in the code to correctly identify a touchscreen device.

Intro to Computing
device = 'touchscreen'
if device [1] 'touchscreen':
    print('Input device detected')
Drag options to blanks, or click blank then click option'
A=
B==
C!=
D=>
Attempts:
3 left
💡 Hint
Common Mistakes
Using '=' instead of '==' in the if condition.
Using invalid operators like '=>'.
4fill in blank
hard

Fill both blanks to create a list of input devices and print the first one.

Intro to Computing
input_devices = ['[1]', '[2]', 'touchscreen']
print(input_devices[0])
Drag options to blanks, or click blank then click option'
Akeyboard
Bmonitor
Cmouse
Dprinter
Attempts:
3 left
💡 Hint
Common Mistakes
Including output devices in the input devices list.
Mixing up the order of devices.
5fill in blank
hard

Fill all three blanks to create a dictionary with device names as keys and their types as values.

Intro to Computing
devices = {
    '[1]': 'input',
    '[2]': 'input',
    '[3]': 'output'
}
print(devices)
Drag options to blanks, or click blank then click option'
Akeyboard
Bmouse
Cmonitor
Dprinter
Attempts:
3 left
💡 Hint
Common Mistakes
Assigning output device types to input devices.
Confusing device names and types.