title: Python random.choice method without repeats?
body: <p>I'm trying to improve this code which asks the user to say what the state capital is when given a state, but I've noticed that sometimes it will repeat a state and ask it twice.  </p>
  
  <p>I tried using random.sample instead, but I got an error "TypeError: Unhashable type: 'list'.  Here is the code that works (but repeats) with the random.sample commented out:</p>
  
  <pre><code>capitals_dict = {
      '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': 'St. 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',
  }
  
  import random
  
  states = list(capitals_dict.keys())
  for i in [1, 2, 3, 4, 5]:
      state = random.choice(states)
      #state = random.sample(states, 5) 
      capital = capitals_dict[state]
      capital_guess = input('What is the capital of ' + state + '?')
  
      if capital_guess == capital:
          print('Correct! Nice job!')
      else:
          print('Incorrect.  The Capital of ' + state + ' is ' + capital + '.')
  
  print('All done.')
  </code></pre>
  
  <p>I also tried just using the dictionary name capitals_dict like this:</p>
  
  <pre><code>random.sample(capitals_dict, 5)
  </code></pre>
  
  <p>but I got a different error then found out that I can't use dictionaries like that.</p>