Skip to content

Commit 0859d1d

Browse files
author
anastomose
committed
Started mailroom.py
1 parent 43bef15 commit 0859d1d

2 files changed

Lines changed: 34 additions & 1 deletion

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#mailroom program to break the monotony
2+
3+
import random
4+
5+
def rd():
6+
return round(random.random() * 100,2)
7+
8+
#this may be a bad idea but we will see, a list of tuples for clients
9+
client_list = [
10+
('Askew', 'Anne'),\
11+
('Bocher', 'Joan'),\
12+
('Clarkson', 'Jeremy'),\
13+
('Hamont', 'Matthew'),\
14+
('May', 'James'),\
15+
('Parris', 'George van')
16+
]
17+
18+
donations = [
19+
(client_list[0], rd(), rd(), rd()),
20+
(client_list[1], rd(), rd()),
21+
(client_list[2], rd(), rd(), rd()),
22+
(client_list[3], rd(), rd(), rd(), rd()),
23+
(client_list[4], rd(), rd(), rd()),
24+
(client_list[5], rd(), rd(), rd())
25+
]
26+
27+
for c in client_list:
28+
for d in donations:
29+
if d[0] == c:
30+
temp_dontation = d[1:]
31+
32+
print "Hello {first} {last}, thanks for donating ${value}"\
33+
.format(last = c[0], first= c[1], value=temp_dontation[0])

‎Students/ebuer/session_03/rot13.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
test_phrase = 'Zntargvp sebz bhgfvqr arne pbeare'
1010
print test_phrase.translate(complete_key)
1111

12-
12+
#Seems too easy! May try again using extended looping for practice.

0 commit comments

Comments
 (0)