plapapyjh
2022-09-24 00:24
采纳率: 48.6%
浏览 46

Python初学者遇到的基础问题

这个代码有点问题,但没有满足原题中每行数字由小到大升序排列的要求,麻烦看一下,在原基础上改一下谢谢

img


上面这个是要求

import random

numbers = int(input("How many quick picks"))
total = []
for i in range(numbers):
    picks = []
    for i in range(6):
        
        while pick in picks:
            pick = random.randint(1,45)
        picks.append(pick)
    picks.sort()
    total.append(picks)
    for j in range(6):
        print(f"picks[j]:{2}",end=' ') 
print(total)

3条回答 默认 最新

相关推荐 更多相似问题