Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! python3
- # randomQuizGenerator.py - Creates quizzes with questions and answers in
- # random order, along with the answer key.
- import random
- # The quiz data. Keys are states and values are their capitals.
- capitals = {
- 'Alabama': 'Montgomery',
- 'Alaska': 'Juneau',
- 'Arizona': 'Phoenix',
- 'Arkansas': 'Little Rock',
- 'California': 'Sacramento',
- 'Colorado': 'Denver',
- 'Connecticut': 'Hartford',
- 'Delaware': 'Dover',
- 'Florida': 'Tallahassee',
- 'Georgia': 'Atlanta',
- 'Hawaii': 'Honolulu',
- 'Idaho': 'Boise',
- 'Illinois': 'Springfield',
- 'Indiana': 'Indianapolis',
- 'Iowa': 'Des Moines',
- 'Kansas': 'Topeka',
- 'Kentucky': 'Frankfort',
- 'Louisiana': 'Baton Rouge',
- 'Maine': 'Augusta',
- 'Maryland': 'Annapolis',
- 'Massachusetts': 'Boston',
- 'Michigan': 'Lansing',
- 'Minnesota': 'Saint Paul',
- 'Mississippi': 'Jackson',
- 'Missouri': 'Jefferson City',
- 'Montana': 'Helena',
- 'Nebraska': 'Lincoln',
- 'Nevada': 'Carson City',
- 'New Hampshire': 'Concord',
- 'New Jersey': 'Trenton',
- 'New Mexico': 'Santa Fe',
- 'New York': 'Albany',
- 'North Carolina': 'Raleigh',
- 'North Dakota': 'Bismarck',
- 'Ohio': 'Columbus',
- 'Oklahoma': 'Oklahoma City',
- 'Oregon': 'Salem',
- 'Pennsylvania': 'Harrisburg',
- 'Rhode Island': 'Providence',
- 'South Carolina': 'Columbia',
- 'South Dakota': 'Pierre',
- 'Tennessee': 'Nashville',
- 'Texas': 'Austin',
- 'Utah': 'Salt Lake City',
- 'Vermont': 'Montpelier',
- 'Virginia': 'Richmond',
- 'Washington': 'Olympia',
- 'West Virginia': 'Charleston',
- 'Wisconsin': 'Madison',
- 'Wyoming': 'Cheyenne'
- }
- # Generate 25 quiz files
- for quizNum in range(35):
- # TODO: Create the quiz and answer key files.
- # TODO: Write out the header for the quiz.
- # TODO: Shuffle the order of the states
- # TODO: Loop through all 50 states, making a question for each.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement