0
0
Pythonprogramming~10 mins

print() function basics in Python - 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 word Hello.

Python
print([1])
Drag options to blanks, or click blank then click option'
Aprint
BHello
C"Hello"
Dhello
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 print the number 5.

Python
print([1])
Drag options to blanks, or click blank then click option'
A5
B"5"
Cfive
Dprint
Attempts:
3 left
💡 Hint
Common Mistakes
Putting quotes around numbers when not needed.
Using words instead of numbers.
3fill in blank
hard

Fix the error in the code to print the word Python.

Python
print([1])
Drag options to blanks, or click blank then click option'
APython
B"Python"
Cprint
D'Python
Attempts:
3 left
💡 Hint
Common Mistakes
Leaving out quotes around text.
Using incomplete quotes like a single quote without closing.
4fill in blank
hard

Fill both blanks to print the sum of 2 and 3.

Python
print([1] [2] [3])
Drag options to blanks, or click blank then click option'
A2
B+
C-
D3
Attempts:
3 left
💡 Hint
Common Mistakes
Using minus - instead of plus +.
Putting numbers inside quotes which prints text, not sum.
5fill in blank
hard

Fill all three blanks to print the message: Hello 5 times.

Python
for i in range([1]):
    print([2] * [3])
Drag options to blanks, or click blank then click option'
A5
B"Hello"
Ci
D3
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong range number.
Not putting Hello inside quotes.
Using variable i instead of number for multiplication.