00:01
This question asks us to write a program in python to calculate the volume of cylinder and cone.
00:06
So what we're doing is python, so def, val.
00:11
Right.
00:12
So how can we calculate the volume of a cylinder and cone? so first of all, what is the formula for volume of a cone, and what is the formula for volume of a cylinder? right.
00:27
So a cylinder volume is equal to pi r squared times h.
00:36
And then for a cone, cone volume is equal to pi r squared h over three.
00:46
So in both of these cases, we need r and we need h.
00:49
So let's say we're given r and we're given h as two inputs into the function, right? or just some values that we have already predetermined.
00:58
So forget this is even a function.
01:00
So we're just going to write python code just directly.
01:05
So what we would do here is we'd say cylinder volume, cylinder vol equals zero, cone volume equals zero.
01:16
So now we have cylinder and cone, both volumes, both equal to zero.
01:22
So then how can we calculate this? so we have an r value, we have an h value...