Python program for performing an arithmetic operations

0
38
num1=float(input("Enter first number:" ))
num2=float(input("Enter second number:"))
op=input("Enter operator [+ - * / %]:")
result=0
if op=='+':
    result=num1+num2
elif op=='-':
    result=num1-num2
elif op=='*':
    result=num1*num2
elif op=='/':
    result=num1/num2
elif op=='%':
    result=num1%num2
else:
    print("Invalid operator!")
print(num1,op,num2,'=',result)

    Output 1:
             Enter first number:15
             Enter second number:17
             Enter operator [+ - * / %]:+
             15.0 + 17.0 = 32.0
    Output 2:
             Enter first number:9
             Enter second number:4
             Enter operator [+ - * / %]:/
             9.0 / 4.0 = 2.25
    Output 3:
             Enter first number:5
             Enter second number:2
             Enter operator [+ - * / %]:%
             5.0 % 2.0 = 1.0

इन्हें भी देखें।

Python Programs के लिये यहाँ click करें।

 

Python program for performing an arithmetic operations program for performing an arithmetic operations in python write a program for performing an arithmetic operations write a program for performing an arithmetic operations in python program to perform arithmetic operations arithmetic operations using functions in python python program to perform all arithmetic operations on two given numbers arithmetic operator program arithmetic operator program in python python program of arithmetic operator program read two number and perform arithmetic operations input two integers and perform arithmetic operations arithmetic operator program in python Python program for perform an arithmetic operations Python program to perform arithmetic operations Python program for performing an arithmetic operations estudyhelper Python program for performing an arithmetic operations estudyhelper.xyz

 

LEAVE A REPLY

Please enter your comment!
Please enter your name here