-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathex6.py
More file actions
41 lines (28 loc) · 916 Bytes
/
ex6.py
File metadata and controls
41 lines (28 loc) · 916 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
36
37
38
39
40
41
# assigns string to the variable x
x = "There are %d types of people." % 10
# assigns string to variable binary
binary = "binary"
# assigns string to variable do_not
do_not = "don't"
# assigns string to variable y
y = "Those who know %s and those who %s." % (binary, do_not)
# prints variable x
print x
# prints variable y
print y
# prints variable string and variable x
print "I said %r." % x
# prints variable string and variable x
print "I also said: '%s'." % y
# assigns boolean value False to variable hilarious
hilarious = False
# assigns string to variable joke_evaluation
joke_evaluation = "Isn't that joke so funny?! %r"
# prints variables joke_evaluation and hilarious
print joke_evaluation % hilarious
# assigns string to variable w
w = "This is the left side of..."
# assigns string to variable e
e = "a string with a right side."
# prints values in variables w and e
print w + e