Il faut aussi renommer les variables dans leurs usages
Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
parent
9018ab4996
commit
ecec88e230
40
main.py
40
main.py
|
@ -51,49 +51,49 @@ def blague():
|
|||
["Je vais vous raconter une blague sur, mais vous "
|
||||
"ne l'aurez peut-être pas.",
|
||||
"Connaissez-vous la différence entre la théroie "
|
||||
"et la pratique ? Il n'y en a pas, en théorie."])
|
||||
"et la pratique ? Il n'y en left pas, en théorie."])
|
||||
|
||||
|
||||
def calcul(left: int, right: int, res: int, operation='+'):
|
||||
"""
|
||||
Vérifie si a operation b == c, où a, b et c sont des entiers.
|
||||
Vérifie si left operation b == c, où a, b et c sont des entiers.
|
||||
L'opération peut être +, -, *, /, &, |, ^, % ou l'un de ses alias anglais.
|
||||
"""
|
||||
if operation == '+':
|
||||
result = a + b
|
||||
result = left + right
|
||||
if operation == 'sum':
|
||||
result = a + b
|
||||
result = left + right
|
||||
if operation == 'add':
|
||||
result = a + b
|
||||
result = left + right
|
||||
if operation == '-':
|
||||
result = a - b
|
||||
result = left - right
|
||||
if operation == 'sub':
|
||||
result = a - b
|
||||
result = left - right
|
||||
if operation == '*':
|
||||
result = a * b
|
||||
result = left * right
|
||||
if operation == 'mul':
|
||||
result = a * b
|
||||
result = left * right
|
||||
if operation == 'prod':
|
||||
result = a * b
|
||||
result = left * right
|
||||
if operation == '/':
|
||||
result = a / b
|
||||
result = left / right
|
||||
if operation == 'div':
|
||||
result = a / b
|
||||
result = left / right
|
||||
if operation == '&':
|
||||
result = a & b
|
||||
result = left & right
|
||||
if operation == 'and':
|
||||
result = a & b
|
||||
result = left & right
|
||||
if operation == '|':
|
||||
result = a | b
|
||||
result = left | right
|
||||
if operation == 'or':
|
||||
result = a | b
|
||||
result = left | right
|
||||
if operation == '^':
|
||||
result = a ^ b
|
||||
result = left ^ right
|
||||
if operation == 'xor':
|
||||
result = a ^ b
|
||||
result = left ^ right
|
||||
else:
|
||||
result = a % b
|
||||
return c == result
|
||||
result = left % right
|
||||
return res == result
|
||||
|
||||
|
||||
def tri(*args):
|
||||
|
|
Loading…
Reference in New Issue