Advertisement
Guest User

randomquizgen

a guest
Feb 19th, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.95 KB | None | 0 0
  1. #! python3
  2. # randomQuizGenerator.py - Creates quizzes with questions and answers in
  3. # random order, along with the answer key.
  4.  
  5. import random
  6.  
  7. # The quiz data. Keys are states and values are their capitals.
  8.  
  9. capitals = {
  10. 'Alabama': 'Montgomery',
  11. 'Alaska': 'Juneau',
  12. 'Arizona': 'Phoenix',
  13. 'Arkansas': 'Little Rock',
  14. 'California': 'Sacramento',
  15. 'Colorado': 'Denver',
  16. 'Connecticut': 'Hartford',
  17. 'Delaware': 'Dover',
  18. 'Florida': 'Tallahassee',
  19. 'Georgia': 'Atlanta',
  20. 'Hawaii': 'Honolulu',
  21. 'Idaho': 'Boise',
  22. 'Illinois': 'Springfield',
  23. 'Indiana': 'Indianapolis',
  24. 'Iowa': 'Des Moines',
  25. 'Kansas': 'Topeka',
  26. 'Kentucky': 'Frankfort',
  27. 'Louisiana': 'Baton Rouge',
  28. 'Maine': 'Augusta',
  29. 'Maryland': 'Annapolis',
  30. 'Massachusetts': 'Boston',
  31. 'Michigan': 'Lansing',
  32. 'Minnesota': 'Saint Paul',
  33. 'Mississippi': 'Jackson',
  34. 'Missouri': 'Jefferson City',
  35. 'Montana': 'Helena',
  36. 'Nebraska': 'Lincoln',
  37. 'Nevada': 'Carson City',
  38. 'New Hampshire': 'Concord',
  39. 'New Jersey': 'Trenton',
  40. 'New Mexico': 'Santa Fe',
  41. 'New York': 'Albany',
  42. 'North Carolina': 'Raleigh',
  43. 'North Dakota': 'Bismarck',
  44. 'Ohio': 'Columbus',
  45. 'Oklahoma': 'Oklahoma City',
  46. 'Oregon': 'Salem',
  47. 'Pennsylvania': 'Harrisburg',
  48. 'Rhode Island': 'Providence',
  49. 'South Carolina': 'Columbia',
  50. 'South Dakota': 'Pierre',
  51. 'Tennessee': 'Nashville',
  52. 'Texas': 'Austin',
  53. 'Utah': 'Salt Lake City',
  54. 'Vermont': 'Montpelier',
  55. 'Virginia': 'Richmond',
  56. 'Washington': 'Olympia',
  57. 'West Virginia': 'Charleston',
  58. 'Wisconsin': 'Madison',
  59. 'Wyoming': 'Cheyenne'
  60. }
  61.  
  62. # Generate 25 quiz files
  63. for quizNum in range(35):
  64. # TODO: Create the quiz and answer key files.
  65.  
  66. # TODO: Write out the header for the quiz.
  67.  
  68. # TODO: Shuffle the order of the states
  69.  
  70. # TODO: Loop through all 50 states, making a question for each.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement