def ball_height_velocity(v0, t, g=9.81):
    """Function to calculate height and velocity of ball.
    
    Parameters
    ----------
    v0 : float
        Set initial velocity (units, m/s).
    t : float
        Time at which we want to know the height of the ball (units, seconds).
    g : float, optimal
        Acceleration due to gravity, by default 9.81 m/s^2.

    Returns
    -------
    float
        Height of ball in meters.
    float
        Velocity of ball in m/s.
    """

    height = v0*t - 0.5*g*t**2
    velocity = v0 - g*t
    
    return height, velocity