import math
defcalculate_of_pentagonal_area():
r =eval(input("Enter the length from the center to a vertex:"))
s =2* r * math.sin(math.pi/5)
area =5* s * s/(4* math.tan(math.pi/5))print("The area of the pentagon is %.2f"%area)
defcalculate_of_spherical_distance():
x1,y1 =eval(input("Enter point 1 (latitude and longtitude)in degrees:"))
x2,y2 =eval(input("Enter point 2 (latitude and longtitude)in degrees:"))
radius =6371.01
d = radius * math.acos(math.sin(math.radians(x1))* math.sin(math.radians(x2))+
math.cos(math.radians(x1))* math.cos(math.radians(x2))* math.cos(math.radians(y1-y2)))print("The distance between the two points is %f"%d)
3、找出ASCII字符,接收一个ASCII码值(1-127),然后显示它对应的字符,
deffind_real():
asc =eval(input("Enter an ASCII code: "))
ch =str(input("Enter the char number:"))
real =chr(asc)
char =ord(ch)print("The character is %s"%real)print("The ASC_num is %d"%char)
1、几何学:一个五边形的面积 编写一个程序,提示用户输入五边形顶点到中心的距离r,然后算出五边形的面积import mathdef calculate_of_pentagonal_area(): r = eval(input("Enter the length from the center to a vertex:")) s = 2 * r * math.sin(math....