Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to print a new line between words.
Python
print("Hello[1]World")
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using \t which adds a tab space instead of a new line.
Using \\ which prints a backslash.
Using \r which returns the cursor to the start of the line.
✗ Incorrect
The escape character \n creates a new line in the output.
2fill in blank
mediumComplete the code to print a tab space between words.
Python
print("Hello[1]World")
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using \n which adds a new line instead of a tab.
Using \\ which prints a backslash.
Using \r which returns the cursor to the start of the line.
✗ Incorrect
The escape character \t adds a horizontal tab space in the output.
3fill in blank
hardFix the error in the code to print a backslash character.
Python
print("This is a backslash: [1]")
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a single backslash \ which causes an error or escape sequence.
Using \n or \t which print new line or tab instead.
✗ Incorrect
To print a single backslash, you need to escape it with another backslash: \\.
4fill in blank
hardFill both blanks to print a quote inside a string.
Python
print("She said, [1]Hello[2]")
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using unescaped double quotes which break the string.
Using single quotes which won't print double quotes.
✗ Incorrect
To print double quotes inside a double-quoted string, use the escape character \".
5fill in blank
hardFill all three blanks to print a file path with backslashes.
Python
print("C:[1]Users[2]Documents[3]file.txt")
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using single backslash \ which causes errors.
Using forward slash / which is different from backslash.
✗ Incorrect
Backslashes in file paths must be escaped as \\ to print correctly.