0
0
Pythonprogramming~10 mins

Writing multiple lines 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 two lines of text.

Python
print('Hello')
print([1])
Drag options to blanks, or click blank then click option'
A"World!"
BWorld!
C'World!'
DWorld
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting quotes around the text.
Using text without quotes causing a NameError.
2fill in blank
medium

Complete the code to print three lines, each with a different word.

Python
print('Line 1')
print([1])
print('Line 3')
Drag options to blanks, or click blank then click option'
A'Line 2'
BLine 2
Cline 2
D"Line 2"
Attempts:
3 left
💡 Hint
Common Mistakes
Missing quotes causing errors.
Using unquoted text which is treated as a variable.
3fill in blank
hard

Fix the error in the code to print two lines correctly.

Python
print('First line')
print([1])
Drag options to blanks, or click blank then click option'
Asecond line
B'Second line'
CSecond line
D"Second line"
Attempts:
3 left
💡 Hint
Common Mistakes
Leaving out quotes causing NameError.
Using unquoted text as if it were a string.
4fill in blank
hard

Fill both blanks to print three lines with correct strings.

Python
print('Start')
print([1])
print([2])
Drag options to blanks, or click blank then click option'
A'Middle'
BMiddle
C'End'
DEnd
Attempts:
3 left
💡 Hint
Common Mistakes
Using unquoted words causing errors.
Mixing quoted and unquoted text.
5fill in blank
hard

Fill all three blanks to print a three-line poem.

Python
print([1])
print([2])
print([3])
Drag options to blanks, or click blank then click option'
A'Roses are red,'
B'Violets are blue,'
C'Sugar is sweet.'
D'Sugar is sour.'
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting quotes around text.
Using incorrect poem lines.