nouveau fichier : calcul.py
This commit is contained in:
27
calcul.py
Executable file
27
calcul.py
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Created on Wed Jun 27 18:50:20 2018
|
||||
|
||||
@author: svnet
|
||||
"""
|
||||
|
||||
import random
|
||||
|
||||
while 1:
|
||||
# Tirage au sort des nombres
|
||||
a = random.randint(0,1000)
|
||||
b = random.randint(0,1000)
|
||||
print("Tapez 0 comme résultat pour Quitter\n")
|
||||
|
||||
# On pose l'opération
|
||||
print("Combien font ", a, " + ", b, " = ")
|
||||
op = int(input())
|
||||
# Vérification
|
||||
if op == 0:
|
||||
print("Au revoir et à Bientôt !!")
|
||||
break
|
||||
if op == (a+b):
|
||||
print("Exact !!\n")
|
||||
else:
|
||||
print("Faux !!\nLe Résultat était : ", (a+b), "\n")
|
||||
Reference in New Issue
Block a user