import random
def shuerte():
a = random.randint(1, 25)
nums = list()
nums.append(a)
while True:
i = 0
a = random.randint(1, 25)
for num in nums:
if num == a:
i = 1
break
if i == 0:
nums.append(a)
if len(nums) == 25:
break
return nums
def shuerte_zu():
a, b = shuerte(), shuerte()
i, j = 0, 0
for a1 in a:
print(a1, end="\t")
i += 1
if i % 5 == 0:
print(end="\t")
for b1 in b:
print(b[j], end="\t")
j += 1
if j % 5 == 0:
print()
break
def main():
zu = int(input("请输入要生成的组数:"))
while zu:
shuerte_zu()
print()
zu -= 1
if __name__ == '__main__':
main()
以下数据随机生成
运行结果:
请输入要生成的组数:6
36118156415111
20171014232423101922
1216255132512821
1921892414317259
2114227187161320
2415245212531619
25232217914121325
13142171915119231
682031817227246
16101111220101884
92310171315191210
5142541123125813
72631621671722
820121319241114202
21221518244189516
72319102125211763
13817524789191
221614113122042414
18492015152112316
1122526182213510
25384112220251121
13142369162171215
12241102219233724
25718211419513
17152019161846810
141781215241312615
2562722411102122
32011991721889
1124452325191145
101816132131623720
Process finished with exit code 0