Question

11 Normal No Spacing Heading 1 Heading 2 .Implement the following algorithm in Python a D D. a A rhombus is a parallelogram w

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Complete Python program with output for the given problem is given below :

Python Code :

import math

def rhombusPerimeter(d1, d2):
perimeter = 2 * math.sqrt(pow(d1, 2) +
pow(d2, 2))
  
print("The perimeter of rhombus with diagonals",
d1, "and", d2, "is", perimeter, "." )
  

def d1():
dia1 = int(input("Enter diagonal 1 : "))
return dia1
  
def d2():
dia2 = int(input("Enter diagonal 2 : "))
return dia2
  

if __name__ == '__main__':
x=d1()
y=d2()
rhombusPerimeter(x, y)

Output :

Enter diagonal 1 : 5 Enter diagonal 2 : 6 The perimeter of rhombus with diagonals 5 and 6 is 15.620499351813308 - .. Program

If you have any doubt regarding the solution then let me know in comment. If it helps, kindly give an upVote to this answer.
  

Add a comment
Know the answer?
Add Answer to:
11 Normal No Spacing Heading 1 Heading 2 .Implement the following algorithm in Python a D...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT