#PYTHON TQC考題110_正 n 邊形面積計算
import math
n=eval(input()) #8邊形
#電子檔題目誤導為5邊形
s=eval(input()) #邊長或半徑=6
area=(n*s**2)/(4*math.tan(math.pi/n))
print(“Area = {:.4f}”.format(area))

import math
n=eval(input()) #8邊形
s=eval(input()) #邊長或半徑=6
area=(n*s**2)/(4*math.tan(math.pi/n))
area1=(n*math.pow(s,2))/(4*math.tan(math.pi/n))
#第二種作法,s的2次方
#math.pi就好,非math.pi() ,
#不能呼叫參數,不用()
print(“Area = {:.4f}”.format(area))
print(“Area1 = {:.4f}”.format(area1))
#第二種作法

#8邊形,邊長或半徑=6
#電子檔pdf排版有誤,未上標








![Python常用的模組內建常數; __name__ ; __file__ ; __doc__ ; __all__ ;__dict__; vars()->Dict[str,str] ; dir()->List[str] Python常用的模組內建常數; __name__ ; __file__ ; __doc__ ; __all__ ;__dict__; vars()->Dict[str,str] ; dir()->List[str]](https://i0.wp.com/savingking.com.tw/wp-content/uploads/2022/11/20221112184006_50.png?quality=90&zoom=2&ssl=1&resize=350%2C233)



近期留言