summaryrefslogtreecommitdiff
path: root/wk6
diff options
context:
space:
mode:
Diffstat (limited to 'wk6')
-rw-r--r--wk6/lect/calculator.py24
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()