-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathex7.py
More file actions
56 lines (38 loc) · 1.48 KB
/
ex7.py
File metadata and controls
56 lines (38 loc) · 1.48 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Prints text specified in quotes
print "Mary had a little lamb."
# Replaces %s with the word 'snow' and
# Prints text "Its fleece was white as snow" on the screen
print "Its fleece was white as %s." % 'snow'
# Prints text specified in quotes
print "And everywhere that Mary went."
# Prints text specified in quotes (i.e. a dot) 10 times
print "." * 10 # what'd that do?
# Assigns a letter, specified in quotes, to a variable end1
end1 ="C"
# Assigns a letter, specified in quotes, to a variable end2
end2 = "h"
# Assigns a letter, specified in quotes, to a variable end3
end3 = "e"
# Assigns a letter, specified in quotes, to a variable end4
end4 = "e"
# Assigns a letter, specified in quotes, to a variable end5
end5 = "s"
# Assigns a letter, specified in quotes, to a variable end6
end6 = "e"
# Assigns a letter, specified in quotes, to a variable end7
end7 = "B"
# Assigns a letter, specified in quotes, to a variable end8
end8 ="u"
# Assigns a letter, specified in quotes, to a variable end9
end9 = "r"
# Assigns a letter, specified in quotes, to a variable end10
end10 = "g"
# Assigns a letter, specified in quotes, to a variable end11
end11 = "e"
# Assigns a letter, specified in quotes, to a variable end12
end12 = "r"
# watch that comma at the end. try removing it to see what happens
# Comma at the end joins the following 2 lines,
# so the text is printed in 1 line with a space between them
print end1 + end2 + end3 + end4 + end5 + end6,
print end7 + end8 + end9 + end10 + end11 + end12