对大于等于0的和小于0的整数分别反转
def reverse(x: int) -> int: x = int(str(x)[::-1]) if x>= 0 else - int(str(-x)[::-1]) return x if x >= -1<<31 and x < 1<<31 else 0