human
Can you provide a the Python code you requested given the following:
Write a function to create the next bigger number by rearranging the digits of a given number. Here is a solution in Python:
assistant
#Here is the Python code you requested.
 def rearrange_bigger(n):
    nums = list(str(n))
    for i in range(len(nums)-2,-1,-1):
        if nums[i] < nums[i+1]:
            z = nums[i:]
            y = min(filter(lambda x: x > z[0], z))
            z.remove(y)
            z.sort()
            nums[i:] = [y] + z
            return int("".join(nums))
    return False