Apr-29-2021, 09:00 AM
(This post was last modified: Apr-29-2021, 10:38 AM by Larz60+.
Edit Reason: added inline tags
)
Hi
Except if i am mistaken, the function below create an empty list and append random number in this list
Same thing if i try to print the first item
what is wrong please?
Except if i am mistaken, the function below create an empty list and append random number in this list
def toto(): jp = [] for i in range(4): jp.append(random.randint(1,10))I try to display all the list number like this
print(*jp)
but it doesn't worksSame thing if i try to print the first item
print(jp[0]
)what is wrong please?