diff options
author | Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> | 2024-05-03 07:52:24 +0000 |
---|---|---|
committer | Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> | 2024-05-03 07:52:24 +0000 |
commit | 13028339bfd00743c8211bcddfb708a15896ed8c (patch) | |
tree | 321feabbbe784b8db7b1cb36e9367d8f1a9953fd /wk6/lect/calculator.py | |
parent | e4687e7b22440ebf80e410d0631dcf01f6329693 (diff) |
Fri, May 3, 2024, 12:52 AM -07:00
Diffstat (limited to 'wk6/lect/calculator.py')
-rw-r--r-- | wk6/lect/calculator.py | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/wk6/lect/calculator.py b/wk6/lect/calculator.py index 26be429..fa6cfc1 100644 --- a/wk6/lect/calculator.py +++ b/wk6/lect/calculator.py @@ -1,12 +1,24 @@ # import cs50 - +# # x = cs50.get_int("x: ") # y = cs50.get_int("y: ") - +# # print(x + y) -x = int(input("x: ")) -y = int(input("y: ")) +# x = int(input("x: ")) +# y = int(input("y: ")) + +# z = x / y +# print(f"{z:.50f}") + +def get_int(prompt): + return int(input(prompt)) + + +def main(): + x = get_int("x: ") + y = get_int("y: ") + + print(x + y) -z = x / y -print(f"{z:.50f}") +main() |