Python program for Calculate Simple Arithmetic Operation Programs in Python.
2. Write a Program to calculate simple Arithmetic Operation. where a is 5 and b is 2 a = 5 b = 2 print('Addition of a & b : ',a + b) # Addition of a & b : 7 print('Subtract of a & b : ',a - b) # Subtract of a & b : 3 print('Multiply a by b : ',a * b) # Multiply a by b : 10 print('Divided a by b : ',a / b) # Divided a by b : 2.5 03.Calculate the Total and Average of Three subject marks m1=45, m2=56,m3=45 m1=45 m2=56 m3=45 total=m1+m2+m3 avg=total/3.0 print('Total Marks : ',total) #Total Marks : 146 print('Average : ',avg) #Average : 48.666666666666664 04. Calculate Simple Interest. p=1000 n=5 r=2.5 p=1000 n=5 r=2.5 si=p*n*r/100 print('Simple Interest : ', si) #Simple Interest : 125.0
Comments
Post a Comment