0
0
Intro to Computingfundamentals~10 mins

Wearable technology 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 define a wearable device's main function.

Intro to Computing
def wearable_device():
    return [1]
Drag options to blanks, or click blank then click option'
A"Smartwatch"
BSmartwatch
CTrue
D12345
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to put quotes around the string.
Returning a number instead of a string.
2fill in blank
medium

Complete the code to check if a wearable device is active.

Intro to Computing
is_active = [1]
if is_active:
    print("Device is on")
Drag options to blanks, or click blank then click option'
Afalse
B"yes"
C1
DTrue
Attempts:
3 left
💡 Hint
Common Mistakes
Using a string "yes" instead of the boolean True.
Using lowercase true or false which are not valid in Python.
3fill in blank
hard

Fix the error in the code to correctly calculate battery percentage.

Intro to Computing
battery_level = 80
max_battery = 100
percentage = battery_level [1] max_battery * 100
print(percentage)
Drag options to blanks, or click blank then click option'
A/
B-
C+
D*
Attempts:
3 left
💡 Hint
Common Mistakes
Using addition or subtraction instead of division.
Multiplying battery_level by max_battery directly.
4fill in blank
hard

Fill both blanks to create a dictionary of wearable devices and their battery levels.

Intro to Computing
devices = {"watch": [1], "earbuds": [2]
Drag options to blanks, or click blank then click option'
A85
B"active"
C90
D"off"
Attempts:
3 left
💡 Hint
Common Mistakes
Using strings like "active" instead of numbers.
Mixing numbers and strings incorrectly.
5fill in blank
hard

Fill both blanks to filter devices with battery above 50%.

Intro to Computing
filtered = {k: v for k, v in devices.items() if v [1] [2]
print(filtered)

# Expected output: {'watch': 85, 'earbuds': 90}
Drag options to blanks, or click blank then click option'
A>
B50
C<
D==
Attempts:
3 left
💡 Hint
Common Mistakes
Using less than or equal instead of greater than.
Using equality instead of comparison.