Skip to content

Instantly share code, notes, and snippets.

@eloidrai
Last active March 13, 2019 19:23
Show Gist options
  • Save eloidrai/c1939d04538251da3917c5858677579b to your computer and use it in GitHub Desktop.
Save eloidrai/c1939d04538251da3917c5858677579b to your computer and use it in GitHub Desktop.
Conçu pour ma sœur, ce programme permet de se tester sur les tables de multiplication.
# coding: utf-8
import random
x = 0
print("Quelle table veux-tu reviser ?")
t = int(input())
print ("C'est parti.")
for i in range(10):
h = int(random.randint(0,9))
vr = t*h
r = int(input("%s * %s = " %(t, h)))
if (r==vr):
print ("Bien !")
x = x+1
else:
print ("Eh non, c'était %s." %(vr))
print("Ton score est de %s/10" %(x))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment