-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstringsexercise1.py
More file actions
41 lines (32 loc) · 1.22 KB
/
stringsexercise1.py
File metadata and controls
41 lines (32 loc) · 1.22 KB
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
# first_string = 'A literal string'
# second_string = 'A literal string'
# print(second_string == first_string)
# third_string = 'A single quoted literal string with a " double quote'
# fourth_string = "A double quoted literal string with a ' single quote"
# print(third_string)
# print(fourth_string)
# fifth_string = 'A single quoted literal string with an \' escaped single quote'
# sixth_string = "A double quoted literal string with a \" double quote"
# seventh_string = 'A literal string with a \n new line character'
# eighth_string = 'A literal string with a \t tab character'
# print(fifth_string)
# print(sixth_string)
# print(seventh_string)
# print(eighth_string)
# ninth_string = r"A literal string with a \n new line character printed raw"
# print(ninth_string)
# tenth_string = '''A literal string
# on more than one line
# sometimes known as a verbatim string'''
# eleventh_string = """Another literal string
# on more than one line
# using double quotes"""
# print(tenth_string)
# print(eleventh_string)
first = 'Conrad'
second = 'Grant'
third = 'Bob'
print(first, second)
print(first, second, third)
print(first, second, third, sep='-')
print(first, second, third, sep='-', end='.')