I am writing a program that calculates the volume of a cone given the diameter and height but I keep getting this
TypeError: cone() missing 1 required positional argument: 'height'
How do I fix this?
def main():
measure = measurement()
vol = cone(measure)
print("\nThe volume of the cone is,", "%0.2f" % (vol))
def measurement():
diameter = eval(input("Enter the diameter of the cones base:"))
height = eval(input("Enter the height of the cone:"))
return diameter, height
def cone(diameter, height):
pi = 3.14
radius = diameter / 2
volume = (pi * (radius**2) * height) / 3
return volume
main()