1#Store number variables for the two numbers
2
3num1 = input('Enter first number: ')
4num2 = input('Enter second number: ')
5
6#the sum of the two numbers variable
7sum = float(num1) + float(num2)
8sum2 = float(num1) - float(num2)
9sum3 = float(num1) * float(num2)
10sum4 = float(num1) / float(num2)
11
12#what operator to use
13choice = input('Enter an operator, + = addition, - = subtraction, * = multiplication and / = division: ')
14#different sums based on the operators
15if choice == '+':
16 print('The sum of {0} and {1} is {2}'.format(num1, num2, sum))
17
18 if choice == '-':
19 print('The sum of {0} and {1} is {2}'.format(num1, num2, sum2))
20
21if choice == '*':
22 print('The sum of {0} and {1} is {2}'.format(num1, num2, sum3))
23
24if choice == '/':
25 print('The sum of {0} and {1} is {2}'.format(num1, num2, sum4))
26
1#Calculator
2
3import time
4
5def add():
6 n1 = input('Enter a number: ')
7 n2 = input('Enter another number: ')
8 time.sleep(1)
9 print(int(n1)+int(n2))
10
11def multiply():
12 n1 = input('Enter a number: ')
13 n2 = input('Enter another number: ')
14 time.sleep(1)
15 print(int(n1)*int(n2))
16
17def divide():
18 n1 = input('Enter a number: ')
19 n2 = input('Enter another number: ')
20 time.sleep(1)
21 print(int(n1)int(n2))
22
23def subtract():
24 n1 = input('Enter a number: ')
25 n2 = input('Enter another number: ')
26 time.sleep(1)
27 print(int(n1)-int(n2))
28
29run = True
30while run:
31 ans = input('Select an opreation: ')
32 if(ans=='Addition'):
33 add()
34
35 if(ans=='Divide'):
36 divide()
37
38 if(ans=='Multiply'):
39 multiply()
40
41 if(ans=='Subtract'):
42 subtract()
43
44
45
1#Addition Calculator
2a = "Type Number Here"
3b = "Type Another Number"
4print (a * b)
5""""
6
7#Subtraction Calculator
8c = "Type Number Here"
9d = "Type Another Number"
10print (c * d)
11
12#Multiplication Calculator
13e = "Type Number Here"
14f = "Type Another Number Here"
15print (e * f)
16
17#Division Calculator
18g = "Type Number Here"
19h = "Type Another Number"
20print (g * h)
21
22"""
23
1#Addition Calculator
2a = "Type Number Here"
3b = "Type Another Number"
4print (a * b)
5""""
6
7#Subtraction Calculator
8c = "Type Number Here"
9d = "Type Another Number"
10print (c * d)
11
12#Multiplication Calculator
13e = "Type Number Here"
14f = "Type Another Number Here"
15print (e * f)
16
17#Division Calculator
18g = "Type Number Here"
19h = "Type Another Number"
20print (g * h)
21
22"""