From 1ced64316bfee0b7af3f2188870abd77ec342d8c Mon Sep 17 00:00:00 2001 From: anxhul10 Date: Thu, 20 Jun 2024 10:17:03 +0530 Subject: [PATCH] add_two_number.py --- add_two_number.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 add_two_number.py diff --git a/add_two_number.py b/add_two_number.py new file mode 100644 index 00000000000..2824d2c1872 --- /dev/null +++ b/add_two_number.py @@ -0,0 +1,17 @@ +user_input = (input("type type 'start' to run program:")).lower() + +if user_input == 'start': + is_game_running = True +else: + is_game_running = False + + +while (is_game_running): + num1 = int(input("enter number 1:")) + num2 = int(input("enter number 2:")) + num3 = num1+num2 + print(f"sum of {num1} and {num2} is {num3}") + user_input = (input("if you want to discontinue type 'stop':")).lower() + if user_input == "stop": + is_game_running = False +