Skip to content

Instantly share code, notes, and snippets.

@horstjens
Created June 10, 2023 14:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save horstjens/4d595744093126e98f53c71ca47b8154 to your computer and use it in GitHub Desktop.
Save horstjens/4d595744093126e98f53c71ca47b8154 to your computer and use it in GitHub Desktop.
import random
import time
zahl1 = random.randint(1,15)
zahl2 = random.randint(1,15)
startzeit = time.time()
while True:
print(f"Wieviel ist {zahl1*zahl2} / {zahl2} ?")
antwort = input(">>>")
if antwort == str(zahl1):
break
print("falsch!")
dauer = time.time() - startzeit
print(f"richtig! du hast {dauer:.2f} Sekunden gebraucht")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment