Skip to content

Commit fbaa17a

Browse files
committed
Added an awesome calculator
1 parent bc282df commit fbaa17a

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

CalcPRO+.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
print("Welcome to the PRO version of Calculator+! This calculator\nhas the ability to add, subtract, multiply,\ndivide. Remember that multiple numbers are not compatible with division. This calculator is only compatible with four numbers.")
2+
num1 = float(input("First Number?"))
3+
op = input("Enter operator, ex. +, -, *, /:")
4+
num2 = float(input("Second Number?"))
5+
num3 = float(0)
6+
num4 = float(0)
7+
neednum1 = ()
8+
neednum = input("Do you need another number? yes or no for our server is case sensitive. :)")
9+
if neednum == "yes":
10+
num3 = float(input("Third Number?"))
11+
neednum1 = input("Do you need another number? yes or no for our server is case sensitive. :)")
12+
elif neednum == "no":
13+
print()
14+
15+
if neednum1 == "yes":
16+
num4 = float(input("Fourth Number?"))
17+
elif neednum == "no":
18+
print()
19+
20+
21+
22+
if op == "+":
23+
print(num2 + num1 + num3 + num4)
24+
elif op == "-":
25+
print(num1 - num2 + num3 - num4)
26+
elif op == "*":
27+
print(num2 * num1 * num4 * num3)
28+
elif op == "/":
29+
print(num1 / num2)
30+
else:
31+
print("You have entered an incorrect character.")
32+
print("To restart, you will need to re-run your calculator.")
33+
exit()
34+

0 commit comments

Comments
 (0)