Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 ")
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DNA Databases

Authors: Stefan Kiesbye

1st Edition

0737758910, 978-0737758917

More Books

Students also viewed these Databases questions