From e8fc6d0816b5423a8345534a08f2b2aeabc59118 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Thu, 28 Jan 2021 14:47:20 +0100 Subject: [PATCH] =?UTF-8?q?On=20remplace=20les=20if=20en=20elif=20pour=20a?= =?UTF-8?q?voir=20un=20r=C3=A9sultat=20correct?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yohann D'ANELLO --- main.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/main.py b/main.py index 376d083..14d7902 100755 --- a/main.py +++ b/main.py @@ -85,17 +85,17 @@ def calcul(left: int, right: int, res: int, operation='+'): if operation in ['+', 'add', 'sum']: result = left + right - if operation in ['-', 'sub']: + elif operation in ['-', 'sub']: result = left - right - if operation in ['*', 'mul', 'prod']: + elif operation in ['*', 'mul', 'prod']: result = left * right - if operation in ['/', 'div']: + elif operation in ['/', 'div']: result = left / right - if operation in ['&', 'and']: + elif operation in ['&', 'and']: result = left & right - if operation in ['|', 'or']: + elif operation in ['|', 'or']: result = left | right - if operation in ['^', 'xor']: + elif operation in ['^', 'xor']: result = left ^ right else: result = left % right