Answers for "make calculator in python using funtions"

1

basic calculator in python

#My Personal Python calculator
print("My Personal Python calculator")
#inputs
num1 = int(input('Enter the first number:  '))
num2 = int(input('Enter the second number:  '))
#opration req
opr = input('Enter the type of operation you want to perform between your chosen two numbers:  ')
#calculation
if opr=='+':
    ans = num1 + num2
    # displaying the answer
    print(f'Your final answer is {ans}')
elif opr == '- ':
    ans = num1 - num2
    # displaying the answer
    print(f'Your final answer is {ans}')
elif opr=='*':
    ans = num1 * num2;
    # displaying the answer
    print(f'Your final answer is {ans}')
elif opr=='/':
    ans = num1 / num2
    # displaying the answer
    print(f'Your final answer is {ans}')
else:
    print('Invalid Entry!!!')
Posted by: Guest on December-25-2020
0

calculator in python

#Calculator in python
#No modules required
qus = input('')
if(qus=='ADDITON'):
  no1 = int(input())
  no2 = int(input())
  print(no1+no2)
  
if(qus=='MULTIPLICATION'):
  no1 = int(input())
  no2 = int(input())
  print(no1*no2)

if(qus=='DIVISION'):
  no1 = int(input())
  no2 = int(input())
  print(no1/no2)
  
if(qus=='SUBTRACTION'):
  no1 = int(input())
  no2 = int(input())
  print(no1-no2)
Posted by: Guest on October-04-2020

Code answers related to "make calculator in python using funtions"

Python Answers by Framework

Browse Popular Code Answers by Language