LuckyLotto
18 January 2019 ·

A simple 7 number generator to help pick winning lotto numbers. As the lucky dips are never lucky.

luckylotto.py

LuckyLotto is a little program that allows you to generate a potential winning EuroMillions ticket.

The program does two things:

  1. Allows the user to generate a tuple of previously drawn numbers and sorts it by most common numbers drawn. Enabling the user to see which numbers were drawn most frequently.

  2. Generate a LuckyDip using the randint() method from random by using a for loop to run six times generating a random number between 1 and 50 using randin() which is then appened to the empty list wining_numbers

for lotto_numbers in range(6):
    lotto_numbers = random.randint(1, 50)
    winning_numbers.append(lotto_numbers)

Once the 6 number list is generated it’s then compared to a list of previous winners as per the below block:

counts = Counter(n for l in pw.previous_lotto_winners for n in l)
winners_count = {n: counts.get(n, 0) for n in winning_numbers}
ordered_winners_count = sorted(winners_count.items(), key=operator.itemgetter(1), reverse=True)
print(ordered_winners_count)

an example output:

--- # ---
Your luckylotto numbers could be [29, 11, 23, 2, 39, 7, 8]

The numbers appear in previous winning numbers this many times:

[(2, 15), (8, 15), (11, 14), (7, 10), (23, 7), (29, 4), (39, 3)]

euro_mill_scraper.py

The idea behind this file is to scrape the past winning euromillion numbers, store each one it it’s own list. To then later compare the luckylotto.py generated number to see if there are any regualr patterns.

TODO:

  • - scrape just the numbers and place in their own list
  • - export the generated lists into a csv
  • - compare luckylotto.py agaisnt the col of lists in the csv
  • [ x ] - check for patterns to see if the generated number is similar in anyway to past numbers

GitHub Link here