Jul-03-2019, 02:59 PM
Hello!
I just started to learn python and I'm a bit lost at the moment.
Also new here, so correct me if and when I'm doing something wrong.
I'm trying to make lottery rows that compare themselves to those already existing.
Decided to ask here, because I don't even know how to google this problem.
Thank you for your help in advance.
#Code here below
I just started to learn python and I'm a bit lost at the moment.
Also new here, so correct me if and when I'm doing something wrong.
I'm trying to make lottery rows that compare themselves to those already existing.
Decided to ask here, because I don't even know how to google this problem.
Thank you for your help in advance.
#Code here below
import random list=[] def lotto(): for i in range(10): r=random.randint(1,100) if r not in list: list.append(r) a = 1 while a < 10: lotto() print(list) a += 1first three lines of the output are:
Output:[50, 8, 14, 96, 25, 79, 66, 61, 31]
[50, 8, 14, 96, 25, 79, 66, 61, 31, 40, 19, 56, 37, 27, 29, 58, 74]
[50, 8, 14, 96, 25, 79, 66, 61, 31, 40, 19, 56, 37, 27, 29, 58, 74, 11, 39, 67, 41, 33, 60, 26, 24]