@AyushMalhotra/

FaintRepentantAstrophysics

Python

No description

fork
loading
Files
  • main.py
main.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
def add(x, y,l):
   return x + y + l
def subtract(x, y, l):
   return x - y-l
def multiply(x, y,l):
   return x * y *l
def divide(x, y, l):
   return x / y/l

ayy1 = int(input("Enter first number: "))
num2 = int(input("Enter second number: "))



print("Select first operation.")
print("1.Add")
print("2.Subtract")
print("3.Multiply")
print("4.Divide")
choice = input("Enter choice(+,-,*,/):")


while True:
  if choice == '+':
    print(ayy1,"+",num2, "=", ayy1+num2)

  elif choice == '-':
    print(ayy1,"-",num2, "=", ayy1 - num2)

  elif choice == '*':
    print(ayy1,"*",num2,"=", ayy1 * num2)

  elif choice == '/':
    print(ayy1,"/",num2,"=", ayy1/num2)
  else: 
    print("Invalid Input")