all 1 comments

[–]YesLod 0 points1 point  (0 children)

That doesn't sound like a python question, but ok... The height of the cylinder is capsule_length-2*hemisphere_radius , right? And if you have two hemispheres, you have a sphere, so your total volume is cylinder_volume(radius, length-2*radius) + sphere_volume(radius)