求大神指教错误
#计算圆的面积import math#导入数学模块
r = input("请输入圆的半径: ")#输入圆的半径
def compute_area_of_circle(r)#计算圆的半径函数
return round(math.pi*r*r,2)#返回值取小数点后两位
print("圆的面积为:",compute_area_of_circle(r))#输出结果
运行结果:
C:\Users\Administrator\AppData\Local\Programs\Python\Python37\python.exe D:/teach/100例/3.py
File "D:/teach/100例/3.py", line 4
def compute_area_of_circle(r)#计算圆的半径函数
^
SyntaxError: invalid syntax
Process finished with exit code 1