1. #Date 7th Dec 2015.
#Today we are going to perform following functions.
#Lets define a function to convert dollar to pakistan ruppe.
def Dollar_To_Ruppe(R):
return(R*105.33)
print Dollar_To_Ruppe(5)
print Dollar_To_Ruppe(10)
#Lets define a function to convert F to C & C to F.
def Farenheit_To_Celsius(F):
return(F-32)*5/9
print Farenheit_To_Celsius(5)
print Farenheit_To_Celsius(10)
def Celsius_To_Farenheit(C):
return(C*9/5+32)
print Celsius_To_Farenheit(5)
print Celsius_To_Farenheit(10)
#Now lets define a function to find area of rectangle,triangle,circle.
def Area_of_rectangle(L,W):
return(L*W)
print Area_of_rectangle(5,5)
def Area_of_triangle(b,h):
return(1/2*b*h)
print Area_of_triangle(2,2)
def Area_of_circle(r):
return 3.14*(r*r)
print Area_of_circle(5)
#Now we are going to define a function to calculate the circumference of a
circle.
def Circumference_of_circle(r):
return 2*3.14*(r)
print Circumference_of_circle(2)
#Lets define a function to calculate the square of an integer.
def square(n):
return (n*n)
print square(2)
#Now we are going to define a function to calculate the cube of an integer.
def cube(r):
return(r*r*r)
print cube(5)