# This way in new learn book subdefcalculate_resul(kinds_polygon):print("All kinds polygon for area: ")# first time learn this k and v so is new way and new happy!!for k, v in kinds_polygon.items():print(f'The {k} area of the {str(v)} is {area_calculate(v)}.')
3th time. forget area calculate o!o! we are return following
defarea_calculate(v):# pay attention input side length in this line
side_length =eval(input('Enter the side: '))
area =(v *pow(side_length,2))/(4* tan(pi / v))# In general, I will write this return round(area,n)...return area
OK whole program code
from math import*
side_contents ={'triangle':3,'pentagon':5,'rectangle':4,'hexagon':6}defcalculate_resul(kinds_polygon):print("All kinds polygon for area: ")for k, v in kinds_polygon.items():print(f'The {k} area of the {str(v)} is {area_calculate(v)}.')defarea_calculate(v):
side_length =eval(input('Enter the side: '))
area =(v *pow(side_length,2))/(4* tan(pi / v))return area
calculate_resul(side_contents)