Question: Q . 1 ) ( 5 0 ) Write a Python script that calculates the area of pentagon and hexagon. The area following pentagon (

Q.1)(50) Write a Python script that calculates the area of pentagon and hexagon. The area following pentagon (a polygon with five equal sides and five equal angles) can be calculated using the folfowing formula: Area of pentagon =5(5+252)24a2 where a is the length of the.
The area of a regular hexagon (a polygon with six equal sides and six equal angles) can be calculated using the following general formula: Area of hexagon =3322a2 where a is the length of the.
import math
while True:
shape = input ("Enter shape type (pentacon or hexagon): ")
if
print("This is not a valid shape.")
while True:
a= float (input ("Enter the length: "))
if
break
print ("Length must be positive")
area
if
area =
elif
area
else:
print (f "Area of {} is ")
 Q.1)(50) Write a Python script that calculates the area of pentagon

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Ive reviewed the content in the image you uploaded and here is the Python script that calculates the ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!