Jul-03-2019, 03:59 PM
Thank you!
With this it worked better, but I'll continue learning!
With this it worked better, but I'll continue learning!
import random def lotto(): numbers=[] for i in range(10): r=random.randint(1,100) if r not in numbers: numbers.append(r) print(numbers) a = 1 while a < 10: lotto() a += 1
Output:[91, 55, 59, 47, 67, 23, 37, 75, 74, 89]
[94, 15, 25, 55, 72, 21, 79, 6, 42]
[74, 24, 49, 81, 56, 94, 37, 23, 34, 1]
[34, 23, 42, 71, 35, 89, 62, 70, 28, 84]
[89, 27, 79, 99, 41, 77, 50, 40, 21, 28]
[68, 59, 51, 92, 50, 26, 6, 52, 28, 77]
[62, 56, 85, 66, 4, 90, 65, 52, 26]
[3, 27, 23, 71, 62, 97, 40, 91, 66, 54]
[47, 19, 66, 55, 90, 53, 86, 95, 43, 65]