image
image
image

Escape Sequences in Python

image

The escape sequences enable us to format our output to enhance clarity to the human user. A program will still run successful without using escape sequences but the output will be highly confusing to the human user. Writing and displaying output in expected output is part of good programming practices. The following are commonly used escape sequences.

image

Examples

Start IDLE.

Navigate to the File menu and click New Window.

Type the following:

print("D:\\Lessons\\Programming")

print("Prints\n in two lines")