ValueError: empty range for randrange() (100000, 10000, -90000)

ValueError: empty range for randrange() (100000, 10000, -90000)

第一个数比第二个大...

x = random.randint(100000, 9999)
ValueError: empty range for randrange() (100000, 10000, -90000)

交换两个值,最小的在前

x = random.randint(9999, 100000)