Python functions–Avoid repeating code