<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_lr(lr, epoch, steps, factor):
 """Get learning rate based on schedule."""

    for s in steps:
        if epoch >= s:
            lr *= factor
    return lr