Skip to content

Instantly share code, notes, and snippets.

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

  • Save anonymous/eeda2ce80cd231380bdca3d46595e946 to your computer and use it in GitHub Desktop.

Select an option

Save anonymous/eeda2ce80cd231380bdca3d46595e946 to your computer and use it in GitHub Desktop.
GermanPrepQuiz created by jmesk8 - https://repl.it/@jmesk8/GermanPrepQuiz
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!")
masterlist = [['achten','auf'],['fragen','nach'],['denken','an'],['sich bewerben','um'],['bitten','um'],['abhängen','von'],['gehören','zu']]
mixed = random.sample(masterlist, len(masterlist))
#([['achten','auf'],['fragen','nach'],['denken','an'],['sich bewerben','um'],['bitten','um'],['abhängen','von'],['gehören','zu']])
#print(mixed)
for i in range(len(mixed)):
riddle(mixed[i][0],mixed[i][1])
#for i in range(len(masterlist)):
# quiz = random.randint(0, len(masterlist))
# riddle(masterlist[quiz][0],masterlist[quiz][1])
#i= 0
#for i in range(len(masterlist)):
# riddle(masterlist[i][0],masterlist[i][1])
# i = i+1
@jsupertramp
Copy link

The masterlist [in line 19] is far from complete. But can be built upon. The file that I'm working from is attached here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment