```python
import math

def volume_sphere(r):
    """
    Calculates the volume of a sphere given its radius.

    Args:
        r (float or int): The radius of the sphere.

    Returns:
        float: The volume of the sphere.
    """
    return (4/3) * math.pi * (r ** 3)

```