summaryrefslogtreecommitdiff
path: root/wk6/lect/calculator.py
blob: 0d4e3ab481852b0fc8bfc789ca6424138266b85f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# import cs50
#
# x = cs50.get_int("x: ")
# y = cs50.get_int("y: ")
#
# print(x + y)

# x = int(input("x: "))
# y = int(input("y: "))
#
# z = x / y
# print(f"{z:.50f}")

def get_int(prompt):
    while True:
        try:
            return int(input(prompt))
        except ValueError:
            # print("Not an integer!!! :(:(:(")
            pass


def main():
    x = get_int("x: ")
    y = get_int("y: ")

    print(x + y)


main()