import math
def reportSphereVolume(r):
SphereVolume = ((4/3)*math.pi*((r)**3))
return SphereVolume
def reportSphereSurfaceArea(r):
SphereSurfaceArea = ((4)*math.pi((r)**2))
return SphereSurfaceArea
radius = int(input("What is the radius of the sphere? " ))
reportSphereVolume(radius)
reportSphereSurfaceArea(radius)
Run Code Online (Sandbox Code Playgroud)
执行时,我收到以下内容.
What is the radius of the sphere? 10
Traceback (most recent call last):
File "D:\Thonny\SphereAreaVolume.py", line 16, in <module>
reportSphereSurfaceArea(radius)
File "D:\Thonny\SphereAreaVolume.py", line 11, in reportSphereSurfaceArea
SphereSurfaceArea = ((4)*math.pi((r)**2))
TypeError: 'float' object is not callable
Run Code Online (Sandbox Code Playgroud)
我迷路了,我一直在看视频和阅读教科书,但我仍然无法解决.请帮忙.