You didn’t provide parameters for cal_volume()
and display()
in your def main()
.
It should be:
import math
def main():
radius = get_radius()
calculate = cal_volume(radius)
dis = display(calculate)
# print out the result?
def get_radius():
rad = float(input("Enter the radius :"))
return rad
def cal_volume(radius):
return 4/3*math.pi*radius**3
def display(cal_volume):
print("The volume is :",cal_volume)
main()
1
solved Can someone point out the errors in this code? [closed]