PY
py
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
print("Welcome to my python calculator!")
print("Please enter the numbers.")
num = [1, 2,]
re = "y"
while re == "y":
num[0] = float(input())
#fun fact: I tried to convert the input of op into a float at first. because I'm smart of course
op = input()
num[1] = float(input())
if op == "+":
#why did it take me so long to figure out how to convert the input to a float without crashing the program.
end = num[0] + num[1]
elif op == "-":
end = num[0] - num[1]
elif op == "*":
end = num[0] * num[1]
elif op == "/":
end = num[0] / num[1]
elif op == "%":
end = num[0] % num[1]
else:
print("Invalid characters were used.")
print(num[0], op, num[1], "=", end)
re = input("Enter another problem(y/n)\n")
print("Ending.")
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run