To find the surface area of a cone in Python, we need to use the formula:
S = πr(l + r)
where S
is the surface area, r
is the radius of the base of the cone, and l
is the slant height of the cone.
Here is the Python code to calculate the surface area of a cone:
main.py309 chars11 lines
To use the function, simply pass in the radius and the height of the cone as arguments:
main.py180 chars6 lines
Output:
main.py70 chars2 lines
gistlibby LogSnag