0 Members and 1 Guest are viewing this topic.
# imports random functionimport random# labelling for thunderball outputprint ("Your numbers are - ")# Picks 5 random numbers between 1 and 39# range goes to 40 so that 39 is inclusive, 40 is not inclusive# .sample does not duplicate numbers picked# Outputs these 5 results in a listprint(random.sample(range(1, 40),5))print ("Your Thunderball number is - ")print(random.sample(range(1, 15),1))# interactivity - prints optionsprint ("You have Options - " "\nDonate a percentage of any wins to your favorite project" "\nDonate the stake instead to your favorite project")
thundernext.py
from random import * thunderchoices = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39]thunderball = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] # Picks 5 numbers from the choices x = sample(thunderchoices, 5)# Picks your thunderbally = sample(thunderball, 1) print x print yprint ("You have Options - " "\nDonate a percentage of any wins to your favorite project" "\nDonate the stake instead to your favorite project")
python thunder.py