Hackerss.com

Hackerss.com is a community of amazing hackers

Hackerss is a community for developers, data scientitst, ethical hackers, hardware enthusiasts or any person that want to learn / share their knowledge of any aspect of digital technology.

Create account Log in
hackerss
hackerss

Posted on

Python Calculate area of a circle


def area_circle(radius):
    """
    Calculate the area of a circle.

    Parameters
    ----------
    radius : float
        The radius of the circle.

    Returns
    -------
    float
        The area of the circle.
    """

    #return the area of the circle
    return 3.14 * radius ** 2

#example
result = area_circle(5)
#output
print(result)  #78.5


Enter fullscreen mode Exit fullscreen mode

Top comments (0)