This repository was archived by the owner on Apr 28, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathb300117444.py
More file actions
113 lines (87 loc) · 2.62 KB
/
Copy pathb300117444.py
File metadata and controls
113 lines (87 loc) · 2.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
"""
Created on Tue Apr 6 9:12:35 2020
@author: iDiR
"""
def add():
print ('Vous avez choisi l\'addition ! Parfait, commençons.')
chfUN=input('Entrez un nombre : ')
chfUN=eval(chfUN)
chfSE=input('Entrez un second nombre : ')
chfSE=eval(chfSE)
resultat = chfUN + chfSE
print ('Donc, %s + %s est égal à %s !'%(chfUN,chfSE,resultat))
res=input('Voulez-vous recommencez ? Y/N ')
res = res.upper()
if res == 'Y':
print ('\n \n')
choix()
elif res == 'N':
print ('Bye !')
else:
print('Je t\'avais demandé Y ou N !!!')
def sous():
print ('Vous avez choisi la soustraction ! Parfait, commençons.')
chfUN=input('Entrez un nombre : ')
chfUN=eval(chfUN)
chfSE=input('Entrez un second nombre : ')
chfSE=eval(chfSE)
resultat = chfUN - chfSE
print ('Donc, %s - %s est égal à %s !'%(chfUN,chfSE,resultat))
res=input('Voulez-vous recommencez ? Y/N ')
res = res.upper()
if res == 'Y':
print ('\n \n')
choix()
elif res == 'N':
print ('Bye !')
else:
print('Je t\'avais demandé Y ou N !!!')
def multi():
print ('Vous avez choisi la multiplication ! Parfait, commençons.')
chfUN=input('Entrez un nombre : ')
chfUN=eval(chfUN)
chfSE=input('Entrez un second nombre : ')
chfSE=eval(chfSE)
resultat = chfUN * chfSE
print ('Donc, %s x %s est égal à %s !'%(chfUN,chfSE,resultat))
res=input('Voulez-vous recommencez ? Y/N ')
res = res.upper()
if res == 'Y':
print ('\n \n')
choix()
elif res == 'N':
print ('Bye !')
else:
print('Je t\'avais demandé Y ou N !!!')
def div():
print ('Vous avez choisi la division ! Parfait, commençons.')
chfUN=input('Entrez un nombre : ')
chfUN=eval(chfUN)
chfSE=input('Entrez un second nombre : ')
chfSE=eval(chfSE)
resultat = chfUN / chfSE
print ('Donc, %s : %s est égal à %s !'%(chfUN,chfSE,resultat))
res=input('Voulez-vous recommencez ? Y/N ')
res = res.upper()
if res == 'Y':
print ('\n \n')
choix()
elif res == 'N':
print ('Bye !')
else:
print('Je t\'avais demandé Y ou N !!!')
def choix():
type=input('Entrez le type d\'opération que vous voulez faire (Addition, soustraction, division ou multiplication) : ')
type = type.lower()
if type == 'addition':
add()
elif type =='soustraction':
sous()
elif type =='multiplication':
multi()
elif type == 'division':
div()
else:
print('Tu n\'as pas répondu à ma question !!!')
choix()
choix()