-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathex10.py
41 lines (35 loc) · 982 Bytes
/
ex10.py
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
36
37
38
39
40
41
tabby_cat = "\tI'm tabbed in."
persian_cat = "I'm split\non a line."
backslash_cat = "I'm \\ a \\ cat."
fat_cat = """
I'll do a list:
\t* Cat food
\t* Fishies
\t* Catnip\n\t* Grass
"""
print(tabby_cat)
print(persian_cat)
print(backslash_cat)
print(fat_cat)
# Escape Sequences
print("ASCII bell (BELL): [\a]")
print("Horizontal tab (TAB): [\t]")
print("ASCII vertical tab (VT): [\v]")
"""
while True:
for i in ["/","-","|","\\","|"]:
print("%s\r" % i, )
"""
# Study Drills
triple_single_quotes = '''
I'll do a list:
\t* Cat food
\t* Fishies
\t* Catnip\n\t* Grass
'''
print(triple_single_quotes)
print("Combining %r with double-quote and single-quote escapes and print them out: ")
print("tabby_cat: raw = [%r], str = [%s]" % (tabby_cat, tabby_cat))
print("persian_cat: raw = [%r], str = [%s]" % (persian_cat, persian_cat))
print("backslash_cat: raw = [%r], str = [%s]" % (backslash_cat, backslash_cat))
print("fat_cat: raw = [%r], str = [%s]" % (fat_cat, fat_cat))