Write a function my_cylinder(r,h), where r and h are the radius and height of a cylinder, respectively, and the output is a list [s, v] where s and v are the surface area and volume of the same cylinder, respectively. Recall that the surface area of a cylinder is 2π r2 + 2πrh, and the volume is π r2h. Assume that r and h are 1 by 1 floats.
Test Cases:
In: my_cylinder(1,5)
Out: [37.6991, 15.7080]
In: my_cylinder(2,4)
Out: [62.8319, 37.6991]
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here