나는 이렇게 학습한다/Algorithm & SQL
1022. Area of a Square
daco2020
2022. 10. 22. 16:50
Complete the function that calculates the area of the red square, when the length of the circular arc A is given as the input. Return the result rounded to two decimals.
Note: use the π value provided in your language (Math::PI
, M_PI
, math.pi
, etc)
Solution:
def square_area(A):
import math
return round((A/math.pi*4/2)**2, 2)