220k views
0 votes
Unlike in previous questions where we wanted you to complete a function we had started, here we want you to write a Python function from scratch called surf_area_sphere that takes a single parameter, the radius of a sphere as a floating point number, and returns the surface area of that sphere. You can name your parameter whatever you want.

User Chadit
by
5.6k points

1 Answer

4 votes

Step-by-step explanation:

from math import pi//imports the pi constant

def surf_area_sphere(rad)://naming the function and designating input argument

return 4*pi*rad**2//value to be returned

print("Enter a number: ")

rad = float(input())//collects user input

print(surf_area_sphere(rad))//calls the function

User QuickPrototype
by
5.7k points