Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # print('Testing index_all_districts()')
- parties = ['LIB','NDP','PC','SK']
- votes = [ ['Arm River',207,1457,338,6187], ['Athabasca',262,1756,0,644], ['Batoche',216,2114,0,4471] ]
- cands = [ ['Arm River','Russ','Denise','Raymond','Greg'],
- ['Athabasca','Michael','Buckley','','Philip'],
- ['Batoche','Graham','Clay','','Delbert'] ]
- # Console output should appear similar to below (but all on one line):
- # {
- # 'Arm River': {
- # 'Name': 'Arm River',
- # 'Candidates': {'LIB': 'Russ', 'NDP': 'Denise', 'PC': 'Raymond', 'SK': 'Greg'},
- # 'Votes': {'LIB': 207, 'NDP': 1457, 'PC': 338, 'SK': 6187} },
- # 'Athabasca': {
- # 'Name': 'Athabasca',
- # 'Candidates': {'LIB': 'Michael', 'NDP': 'Buckley', 'PC': '', 'SK': 'Philip'},
- # 'Votes': {'LIB': 262, 'NDP': 1756, 'PC': 0, 'SK': 644} },
- # 'Batoche': {
- # 'Name': 'Batoche',
- # 'Candidates': {'LIB': 'Graham', 'NDP': 'Clay', 'PC': '', 'SK': 'Delbert'},
- # 'Votes': {'LIB': 216, 'NDP': 2114, 'PC': 0, 'SK': 4471} }
- # }
- def index_all_districts(parties, votes, cands):
- regions = [x[0] for x in votes]
- o = 0
- while o in range(len(regions)):
- for j in regions:
- database = {'Name': j, 'Candidates': for h in}
- print(database)
- o += 1
- #return database
- print(index_all_districts(cands,votes,parties))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement