def worst_range(nums, target):
    """
    Given a sorted list, find the range nums[lo:hi] such that all values in the range equal to target.
    """
    if not target in nums:
        return None
    lo = nums.index(target)
    if lo == len(nums) - 1:
        return (lo, lo)
    hi = lo + 1
    while hi < len(nums):
        if nums[hi] != target:
            return (lo, hi - 1)
        hi += 1
    return (lo, hi - 1)