import math # Import the math module for using the value of pi
# Get user input for the radius of the cylinder
radius = float(input("Enter the radius of the cylinder: "))
# Get user input for the height of the cylinder
height = float(input("Enter the height of the cylinder: "))
# Calculate the area of the cylinder using the formula: pi * radius**2 * height
area = math.pi * radius**2 * height
# Print the result
print(f"The surface area of the cylinder with radius {radius} and height {height} is: {area:.2f}")
Output:
Enter the radius of the cylinder: 5
Enter the height of the cylinder: 10
The surface area of the cylinder with radius 5.0 and height 10.0 is: 785.40