python basic programing...with arithematic functions..

#performing aithematic operations using if statemens#read the dataa=int(input("eneter the first number"))
b=int(input("enter the second number: "))
c=int(input("enter the second number: "))
opr=input("enter the prefered operation: ")
print("my operation is: " ,opr)
print("output is")
print("a={} , b={} and c={} ".format(a,b,c))

#process the data
if (opr == '+'):
    print("perform addition...")
    res_add= (a+b+c)
    print("result of adding {} , {} and {} is{}".format(a,b,c,res_add))
elif (opr == '*'):
    print("perform multilication...")
    res_mul= (a*b*c)
    print("result of multiplication {} , {} and {} is{}".format(a,b,c,res_mul))
elif(opr=='/'):
    print("perform division...")
    res_div= (a/b/c)
    print("result of division {} , {} and{} is{}".format(a,b,c,res_div))
else:
    print("sorry data is insufficiant ")

print("thanks....")


***************result*************
C:\Users\Radhikasarma\PycharmProjects\untitled\venv\Scripts\python.exe C:/Users/Radhikasarma/PycharmProjects/untitled/karthikproject.py
eneter the first number50
enter the second number: 50
enter the second number: 50
enter the prefered operation: +
my operation is:  +
output is
a=50 , b=50 and c=50 
perform addition...
result of adding 50 , 50 and 50 is150
thanks....

Process finished with exit code 0

Comments

Popular Posts