Skip to content

Instantly share code, notes, and snippets.

@PatWg

PatWg/s0208.py Secret

Created September 25, 2023 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PatWg/180561dad37ae947c436ec7b2ae05b2c to your computer and use it in GitHub Desktop.
Save PatWg/180561dad37ae947c436ec7b2ae05b2c to your computer and use it in GitHub Desktop.
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