-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path0003_escape.py
More file actions
35 lines (27 loc) · 850 Bytes
/
0003_escape.py
File metadata and controls
35 lines (27 loc) · 850 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
split_string = 'This string has been \nsplit over\nseveral\nline'
print(split_string)
tabbed_string = '1\t2\t3\t4\t5'
print(tabbed_string)
print('The pet shop owner said "No, no, \'e\'s uh,...he\'s resting".')
# or
print("The pet shop owner said \"No, no, 'e's uh,...he's resting\".")
print("""The pet shop owner said "No, no, 'e's uh,...he's resting".""")
# can have multiple lines when enclosed with triple quotes
# This string has been
# split over
# several
# lines
another_split_string = """This string has been
split over
several
lines"""
print(another_split_string)
# escapes the new line
# This string has been split over several lines
another_split_string = """This string has been \
split over \
several \
lines"""
print(another_split_string)
print("C:\\Users\\donqc\\notes.txt");
print(r"C:\Users\donqc\notes.txt") # raw string