-
-
Save PatWg/180561dad37ae947c436ec7b2ae05b2c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
should_continue: bool = True | |
while should_continue: | |
print("Je vais évaluer un calcul pour vous.") | |
number1_string: str = input("Tapez le premier nombre:") | |
number1: int = int(number1_string) | |
number2_string: str = input("Tapez le second nombre:") | |
number2: int = int(number2_string) | |
operation: str = input("Tapez l'opération: ") | |
if operation == "+": | |
result = number1 + number2 | |
print(f"{number1} + {number2} = {result}") | |
else: | |
print(f"Désolé, je ne connais pas l'opération '{operation}'.") | |
maybe_quit: str = input("Tapez 'q' pour quitter, ou autre chose pour recommancer: ") | |
if maybe_quit == 'q': | |
print("Bye!") | |
should_continue = False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment