Skip to content

Instantly share code, notes, and snippets.

@jsupertramp
Created November 15, 2017 11:31
Show Gist options
  • Select an option

  • Save jsupertramp/f880189e7ed6d9a3b5f5b35a15a1f5c3 to your computer and use it in GitHub Desktop.

Select an option

Save jsupertramp/f880189e7ed6d9a3b5f5b35a15a1f5c3 to your computer and use it in GitHub Desktop.
import random
import time
#I have a working function for riddles where i only need to pass the keys and values as arguments!
def riddle(key, value):
attempt = input("What preposition goes with: %s ?\n>>>" % (key))
while attempt != value:
print("Wrong! Try again.(or press s to skip)")
attempt = input("What's the answer? : ")
if attempt == "s":
print("okay, fine, but FYI, the preposition for %s is >>>%s" %(key, value))
time.sleep(1)
attempt = value
else:
print("Good Job! Advance to the next round!")
#### This Master List can be filled with any items you wish to quiz the user on ####################
masterlist = [['achten','auf'],['fragen','nach'],['denken','an'],['sich bewerben','um'],['bitten','um'],['abhängen','von'],['gehören','zu']]
mixed = random.sample(masterlist, len(masterlist))
for i in range(len(mixed)):
riddle(mixed[i][0],mixed[i][1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment