write a python program to calculate the area of rhombus
Answers
Answer:
# This is a python program which calculates the area of a rhombus.
# It is a function to calculate the area of rhombus
def findAreaofrhombus(d1, d2):
return ( ( d1 * d2 ) / 2) # It is a formula which adds the three side and # then return the value to the statement of calling function.
d1 =30
d2= 40
print(findAreaofrhombus(d1,d2))
Hope it helped!
Answer
d1 = float (input ("Enter diagonal 1 :" ) )
d2 = float(input ("Enter diagonal 2 :" ) )
area=(d1*d2)/2
print ("Area :",area)
Example Output
Enter diagonal 1 : 5
Enter diagonal 2 : 7
Area : 17.5
Refer above attatchment for example :)