Advertisement
Guest User

Untitled

a guest
Feb 24th, 2018
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. # print('Testing index_all_districts()')
  2. parties = ['LIB','NDP','PC','SK']
  3. votes = [ ['Arm River',207,1457,338,6187], ['Athabasca',262,1756,0,644], ['Batoche',216,2114,0,4471] ]
  4. cands = [ ['Arm River','Russ','Denise','Raymond','Greg'],
  5. ['Athabasca','Michael','Buckley','','Philip'],
  6. ['Batoche','Graham','Clay','','Delbert'] ]
  7.  
  8. # Console output should appear similar to below (but all on one line):
  9. # {
  10. # 'Arm River': {
  11. # 'Name': 'Arm River',
  12. # 'Candidates': {'LIB': 'Russ', 'NDP': 'Denise', 'PC': 'Raymond', 'SK': 'Greg'},
  13. # 'Votes': {'LIB': 207, 'NDP': 1457, 'PC': 338, 'SK': 6187} },
  14. # 'Athabasca': {
  15. # 'Name': 'Athabasca',
  16. # 'Candidates': {'LIB': 'Michael', 'NDP': 'Buckley', 'PC': '', 'SK': 'Philip'},
  17. # 'Votes': {'LIB': 262, 'NDP': 1756, 'PC': 0, 'SK': 644} },
  18. # 'Batoche': {
  19. # 'Name': 'Batoche',
  20. # 'Candidates': {'LIB': 'Graham', 'NDP': 'Clay', 'PC': '', 'SK': 'Delbert'},
  21. # 'Votes': {'LIB': 216, 'NDP': 2114, 'PC': 0, 'SK': 4471} }
  22. # }
  23.  
  24.  
  25.  
  26. def index_all_districts(parties, votes, cands):
  27. regions = [x[0] for x in votes]
  28.  
  29. o = 0
  30. while o in range(len(regions)):
  31. for j in regions:
  32. database = {'Name': j, 'Candidates': for h in}
  33. print(database)
  34. o += 1
  35. #return database
  36.  
  37. print(index_all_districts(cands,votes,parties))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement