from random import* def rend(): for i in range(10): print(randint(1,10)) rend() a=rend() print(a)
|
2 answers
You assign the variable a
value returned by the rend
function, however, in the rend
function you do not have a return
operator, therefore the function returns nothing. This “nothing” is denoted as None
, which you output using print(a)
- Also, user Igor correctly noted that you do not display 10 numbers, but 20. - Don2Quixote
|
Like this:
# a=rend() # print(a)
PS: You do not appear ten, but twenty digits.
|
print(a)
? - Yaant 4:52 pm