Python Forum
Lottery generator (beginner)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Lottery generator (beginner)
#1
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
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 += 1
first 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]
Reply


Messages In This Thread
Lottery generator (beginner) - by Hullari - Jul-03-2019, 02:59 PM
RE: Lottery generator (beginner) - by ichabod801 - Jul-03-2019, 03:20 PM
RE: Lottery generator (beginner) - by Hullari - Jul-03-2019, 03:59 PM
RE: Lottery generator (beginner) - by perfringo - Jul-03-2019, 04:46 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Need help with defining messages and player guesses in a lottery Kanashi 3 2,336 Nov-23-2019, 10:14 AM
Last Post: ThomasL
  [split] Lottery System on my mobile website sibt007 1 2,458 Sep-27-2018, 12:56 AM
Last Post: micseydel
  Lottery System on my mobile website nooxm123 1 2,624 Feb-06-2018, 10:55 AM
Last Post: j.crater
  receive from a generator, send to a generator Skaperen 9 5,530 Feb-05-2018, 06:26 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020