0
python, help
import random def tab(): rand=[random.randrange(1, 50, 1) for i in range(10)] return rand how to print this rand 5 time, maybe using for or while?
3 odpowiedzi
+ 7
Do you want to print the same list 5 times? Then just add the following at the end of your code:
rand_list = tab()
for i in range(5):
print(rand_list)
But if you want 5 random lists:
for i in range(5):
print(tab())
+ 2
You're welcome! 😊
+ 1
Thanks so much