salutonxxxx 2021-05-14 21:28 采纳率: 100%
浏览 34
已采纳

小白一枚初学python。问题如下,求教怎么解决。感谢!!!

import random

adc= range(300)
qwe = [random.sample(adc, 30)], [random.sample(adc, 10)], [random.sample(adc, 5)]
print(adc)
print(qwe)
for qwe in range (qwe(1,2,3)):
    print(qwe)

in <module> for qwe in range (qwe(1,2,3)):
TypeError: 'tuple' object is not callable

 

  • 写回答

2条回答 默认 最新

  • 关注
    import random
    
    adc= range(300)
    qwe = [random.sample(adc, 30), random.sample(adc, 10), random.sample(adc, 5)]
    print(adc)
    print(qwe)
    for q in qwe:
        print(q)
    

    是这样吗?

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?