0
0
Intro to Computingfundamentals~10 mins

Why programming automates tasks in Intro to Computing - 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 automatically.

Intro to Computing
print([1])
Drag options to blanks, or click blank then click option'
A"Hello, world!"
Bprint
CHello, world!
Dmessage
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting quotes around the text
Using a variable name without defining it
2fill in blank
medium

Complete the code to repeat a task 3 times automatically.

Intro to Computing
for i in range([1]):
    print("Task", i + 1)
Drag options to blanks, or click blank then click option'
A3
B5
C0
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Using 0 which runs no times
Using 1 which runs only once
3fill in blank
hard

Fix the error in the code to automate adding two numbers.

Intro to Computing
result = num1 [1] num2
print(result)
Drag options to blanks, or click blank then click option'
A/
B-
C*
D+
Attempts:
3 left
💡 Hint
Common Mistakes
Using minus (-) which subtracts
Using multiply (*) or divide (/) which do other operations
4fill in blank
hard

Fill both blanks to automate filtering even numbers from a list.

Intro to Computing
evens = [x for x in numbers if x [1] 2 == [2]]
Drag options to blanks, or click blank then click option'
A%
B0
C1
D==
Attempts:
3 left
💡 Hint
Common Mistakes
Using 1 instead of 0 for even check
Using == as operator instead of %
5fill in blank
hard

Fill all three blanks to automate creating a dictionary of word lengths for words longer than 3 letters.

Intro to Computing
lengths = [2]: [2] for [3] in words if len({{BLANK_4}}) > 3
Drag options to blanks, or click blank then click option'
Aword
Blen(word)
D{
Attempts:
3 left
💡 Hint
Common Mistakes
Not starting dictionary with '{'
Using wrong variable names
Not checking word length correctly