Skip to content

[issue:#2010]:python file to add_two_number #2251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions add_two_number.py
Original file line number Diff line number Diff line change
@@ -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

Loading