Turning involves rotating the workpiece on its axis while the cutting tool moves straight along or across it. This combination removes material evenly around the axis, naturally creating cylindrical shapes.
radius = 5 length = 10 volume = 3.1416 * radius ** 2 * length print(f'Volume of cylinder: {volume:.2f}')
The volume of a cylinder is π × r² × h. Here, radius=5 and length=10, so volume = 3.1416 × 25 × 10 = 785.4.
radius = 7 length = 15 volume = 3.1416 * radius ** 2 * length print('Volume of cylinder: {volume:.2f}')
The print statement uses single quotes without an f-string prefix, so the placeholder {volume:.2f} is printed literally instead of the variable's value.
radius = '5' length = 10 volume = 3.1416 * radius ** 2 * length print(f'Volume: {volume}')
radius is a string ('5'), so using the exponent operator ** on it causes a TypeError.
The side area of a cylinder is 2πrh, and the area of two ends is 2πr². Adding these gives total surface area.
