Answered step by step
Verified Expert Solution
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 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 where 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 where is the length of the.
import math
while True:
shape input Enter shape type pentacon or hexagon:
if
printThis is not a valid shape."
while True:
float input Enter the length:
if
break
print Length must be positive"
area
if
area
elif
area
else:
print "Area of is
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started