Python simple program
Python simple program
def simple_interest(p,t,r):
si = (p * t * r)/100
return si
# Driver code
simple_interest(8, 6, 8)
Output
The principal is 8
The time period is 6
The rate of interest is 8
The Simple Interest is 3.84
# Python program to find the
# maximum of two numbers
if a >= b:
return a
else:
return b
# Driver code
a = 2
b = 4
print(maximum(a, b))
Output
4
# Python program to find Area of a circle
def findArea(r):
PI = 3.142
return PI * (r*r);
# Driver method
print("Area is %.6f" % findArea(5));
Output
Area is 78.550000
# Python Program to calculate the square root
Output
if (num % 2) == 0:
else:
Output:
887
887 is odd.