Chapters
Python114 chapters

Exercises

Escape Characters

3 tasks. Write the code, press Check, and the page runs it against a real Python interpreter.

Exercise 1

Print two lines from a single string, using an escape rather than two prints.

Python
# print first then second, from one print call
Exercise 2

Print the Windows path literally, backslashes and all.

Python
# print C:\temp\new\table.csv exactly
Exercise 3

Print the repr of the value so the tabs and newline are visible.

Python
value = "line\twith\ttabs\n"
# show the escapes