本帖最后由 Aub 于 2020-3-26 18:18 编辑
- import random
- import math
-
-
- max = random.randint(9999, 999999)
- min = random.randint(0, (max - 2))
- n = random.randint(1, ((max - min) - 1))
- a = random.randint((min + 100), (min + 3))
- for __count in range(n):
- if (a + 1 < max - 1 or max - 1 < a + 1):
- if (a < max):
- b = 0
- b = random.randint((a + 1), (max - 1))
- print(b)
- a = 0
- a = b
- else:
- b = 0
- b = random.randint((max - 1), (a + 1))
- print(b)
- a = 0
- a = b
- else:
- print('stop')
复制代码 要做不重复数还挺复杂的 |