Uploaded September 2020 | Updated September 2026, 2 weeks ago
Epoch Kickstarter Camaign:
kickstarter.com/projects/172204344/epoch-learn-arduino-coding-and-circuit-design-all-in-1?ref=discovery
Epoch Kickstarter Camaign:
kickstarter.com/projects/172204344/epoch-learn-arduino-coding-and-circuit-design-all-in-1?ref=discovery

![Why you shouldnt play the lottery - A python code simulation (code included)
Here is my code. Im sure that it can be improved upon. Sorry for the lack of commenting. I rarely comment my code, and only do it when I have to =)
from random import randint
import time
import datetime
mylist = [3,15,18,22,37,46]
one = randint(1,60)
randomlist = [0,0,0,0,0,0]
state = 0
counter = 0
x = 0
newtime = 0
enddate = 0
starttime = time.perf_counter()
startdate = datetime.datetime.now().strftime(%m-%d-%Y_%H.%M.%S)
def getNum():
global state
global x
state2 = 0
global randomlist
while state 0:
x = randint(1,49)
for i in range(5):
if ((x != randomlist[0]) and (x != randomlist[1]) and (x != randomlist[3]) and (x != randomlist[4]) and (x != randomlist[5])):
state2 = 1
return x
while state 0:
randomlist[0] = getNum()
randomlist[1] = getNum()
randomlist[2] = getNum()
randomlist[3] = getNum()
randomlist[4] = getNum()
randomlist[5] = getNum()
randomlist.sort()
#print(randomlist)
counter = counter + 1
if randomlist[0] mylist[0]:
if randomlist[1] mylist[1]:
if randomlist[2] mylist[2]:
if randomlist[3] mylist[3]:
if randomlist[4] mylist[4]:
if randomlist[5] mylist[5]:
state = 1
newtime = time.perf_counter()
enddate = datetime.datetime.now().strftime(%m-%d-%Y_%H.%M.%S)
print(Done)
print(My Fixed Numbers = ,mylist)
print(Last Draw Numbers = ,randomlist)
print(Total Draws = ,counter)
dollars = counter * 2
print(At two dollars a ticket, youve spent: $,dollars)
timeyears = counter / 104.286 #Two draws a week
print(It took ,timeyears, years to hit your numbers at two draws a week)
sum = float(newtime) - float(starttime)
print(Program Runtime = , sum, Seconds)
print(Start Date = ,startdate)
print(End Date = ,enddate)
samples_per_second = counter / sum
print(Samples Per Second = ,samples_per_second) Why you shouldnt play the lottery - A python code simulation (code included)](https://i.ytimg.com/vi/yzKqvRx6OV8/mqdefault.jpg)



