<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def headloss(FlowRate, Diam, Length, Nu, PipeRough, KMinor):
 """Return the total head loss from major and minor losses in a pipe. This equation applies to both laminar and turbulent flows. """

    #Inputs do not need to be checked here because they are checked by
    #functions this function calls.
    return (headloss_fric(FlowRate, Diam, Length, Nu, PipeRough).magnitude
            + headloss_exp(FlowRate, Diam, KMinor).magnitude)