Skip to content

Commit c9db361

Browse files
author
meshmote
committed
Created dbase init function and main input loop
1 parent ad0f0f6 commit c9db361

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
__author__ = 'Robert W. Perkins'
2+
3+
4+
def mk_dbase():
5+
"""Create data structure for donor list"""
6+
ndbase = [[], [], [], [], []]
7+
ndbase[0] = ['Jeff McCarthy', 2500, 1000, 500]
8+
ndbase[1] = ['Tabitha Simmons', 450, 2000]
9+
ndbase[2] = ['Angela Cartwright', 5500]
10+
ndbase[3] = ['Billy Murray', 3450, 250]
11+
ndbase[4] = ['Alexa Dalton', 240, 1200, 5500]
12+
return ndbase
13+
14+
15+
def get_input():
16+
"""Ask user whether to send thank you note or create report and return answer"""
17+
answer = None
18+
while not ((answer == '1') or (answer == '2') or (answer == "q")):
19+
new_answer = raw_input("Enter '1' to Send a Thank-You Note, Enter '2' to Create a Report, Enter 'q' to quit")
20+
answer = str(new_answer)
21+
return answer
22+
23+
24+
def thank_you():
25+
""" Find or create a donor, add new donation, and return a thank you note"""
26+
print 'Thank You'
27+
28+
def mk_report():
29+
""" Create a sorted list of donors"""
30+
print 'Report'
31+
32+
if __name__ == '__main__':
33+
donor = mk_dbase()
34+
answer = None
35+
while not (answer == "q"):
36+
answer = get_input()
37+
if answer == "1":
38+
thank_you()
39+
else:
40+
mk_report()
41+
print "Exiting"
42+
43+

0 commit comments

Comments
 (0)