def is_within_distance(number, target_number, distance):
    """ returns true if the number is within 'distance' from the 'target_number' """
    actual_distance = abs(target_number - number)
    return actual_distance <= distance