0
0
Intro to Computingfundamentals~10 mins

Next steps in your computing journey 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 a friendly welcome message.

Intro to Computing
print([1])
Drag options to blanks, or click blank then click option'
A"Hello, friend!"
Bprint("Hello, friend!")
CHello, friend!
DHello friend
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting quotes around text
Trying to print without parentheses
2fill in blank
medium

Complete the code to create a list of numbers from 1 to 5.

Intro to Computing
numbers = list(range(1, [1]))
Drag options to blanks, or click blank then click option'
A1
B5
C6
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Using 5 which excludes 5 itself
Starting range at 1 without adjusting end
3fill in blank
hard

Fix the error in the code to check if a number is even.

Intro to Computing
if number [1] 2 == 0:
    print("Even")
Drag options to blanks, or click blank then click option'
A**
B%
C//
D+
Attempts:
3 left
💡 Hint
Common Mistakes
Using + or ** instead of %
Using // which is floor division
4fill in blank
hard

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

Intro to Computing
{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)
Using < instead of >
5fill in blank
hard

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

Intro to Computing
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()
Using < instead of >