Volume of a Cone

Published by Matt in

Create a function that takes the height and radius of a cone as arguments and returns the volume of the cone rounded to the nearest hundredth.

Volume of a Cone Image

Examples

cone_volume(3, 2) ➞ 12.57

cone_volume(15, 6) ➞ 565.49

cone_volume(18, 0) ➞ 0

Notes

  • See the resources tab for the formula.
  • Return approximate answer by rounding the answer to the nearest hundredth.
  • If the cone has no volume, return 0.
Watch a quick demo on how Edabit works.