Python Program to perform all arithmetic operations in menu


print(''' main menu

1.add

2.sub

3.div

4.milt

5.exit''')

n1=int(input('enter any n1'))

n2=int(input('enter any n2'))

while True:

  ch=int (input('enter your choice'))

  if ch==1:

    print(n1+n2)

  elif ch==2:

    print(n1-n2)

  elif ch==3:

    print(n1*n2)

  elif ch==4:

    print(n1/n2)

  elif ch==5:

    print('you have exited!')

    break

  else:

    print('invalid choses')

Comments

Some popular posts

Python Program that computes the net amount of a bank account based a transaction log from console input.