You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
591 B

  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. """
  4. Created on Wed Jun 27 18:50:20 2018
  5. @author: svnet
  6. """
  7. import random
  8. while 1:
  9. # Tirage au sort des nombres
  10. a = random.randint(0,1000)
  11. b = random.randint(0,1000)
  12. print("Tapez 0 comme résultat pour Quitter\n")
  13. # On pose l'opération
  14. print("Combien font ", a, " + ", b, " = ")
  15. op = int(input())
  16. # Vérification
  17. if op == 0:
  18. print("Au revoir et à Bientôt !!")
  19. break
  20. if op == (a+b):
  21. print("Exact !!\n")
  22. else:
  23. print("Faux !!\nLe Résultat était : ", (a+b), "\n")