def main():
ran = fillaray()
totalOdds(ran)
def fillaray():
size = 10
num = [0] * size
import random
for index in range(size):
var = random.randint(0,9)
num[index] = var
return num
def totalOdds(ran):
print(ran)
我正在尝试用 10 个随机整数填充“num”,然后将其返回给 main。我不熟悉返回和传递数组,所以我遇到了问题。
谢谢您的帮助!