Skip to content

Commit

Permalink
new file: calc_main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
roidsaja committed Oct 10, 2019
1 parent 80fb7c3 commit 43190e4
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions calc_main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import math
while True:
print("MENU")
print("1 for addition :")
print("2 for subtraction :")
print('3 for multiplication :')
print("4 for raise to power:")
print("5 for Division:")
print("6 for floor division:")
print("7 for factorial:")
choice=int(input("enter any choice:"))
def additon():
a=int(input("enter 1st no to perform addition:")) #a-first input
b=int(input("enter 2nd no to perform addition:")) #b-second input
c=a+b
print("sum is:",c)
return
def subtract():
a = int(input("enter 1st no to perform subtraction:"))
b = int(input("enter 2nd no to perform subtraction:"))
c = a - b
print("subtraction is:", c)
return
def multiplication():
a = int(input("enter 1st no to perform multipication:"))
b = int(input("enter 2nd no to perform multiplication:"))
c = a*b
print("multiplication is:", c)
return
def power():
a = int(input("enter base :"))
b = int(input("enter power :"))
c = a**b
print("division is:", c)
return

def divide():
a = int(input("enter 1st no to perform division:"))
b = int(input("enter 2nd no to perform division:"))
c = a/b
print("division is:", c)
return
def floor_division():


def factorial():

if choice==1:
additon()
elif choice==2:
subtract()
elif choice==3:
multiplication()
elif choice==4:
power()
elif choice==5:
divide()
elif choice==6:
floor_division()
elif choice==7:
factorial()
else:
print("wrong input")
exit(0)

0 comments on commit 43190e4

Please sign in to comment.