Write a Python program to get the volume of a sphere with radius six.

Program


def myfun():
    # Define the value of pi
    pi = 3.1415926535897931

    # Define the radius of the sphere
    r = 6.0

    # Calculate the volume of the sphere using the formula V = 4/3 * pi * r^3 
    V = 4.0/3.0 * pi * r**3

    # Print the calculated volume of the sphere
    print('The volume of the sphere is: ', V)
      
if __name__=="__main__":      
    myfun()

Output:

The volume of the sphere is: 904.7786842338603

For latest job updates join Telegram Channel: https://t.me/sateeshm

Programs