hello and thank you everyone for your help.
I apologize for my ignorance when it came to knowledge of what the powerball is it is not as wide spread as i had thought it was

the powerball is a form of lottery their are 5 numbers between 1 and 55, and then their is the powerball between 1 and 42 players win different amounts of money depending on how many numbers they had right the program i wrote uses the number 146107962 as the amount of tickets in play i found this number on the powerball stat as the probability of getting jackpot 1 / 146107962 included is the finished and working script if anyone would like to use or play with it.

from random import randrange # for creating random numbers
wins=0 # to see how many people would win
win=[] # the winning numbers go here 
count=0 
for count in range(5): # powerball uses 5 numbers
    win.append(randrange(55)+1) 
powerball=randrange(42)+1 
count=0
while count != 146107962: # point of information useing for count in range(146107962) will overlaoad with this large a number 
    numbers=[] # guesses
    count2=0
    for count2 in range(5):
        number=randrange(55)+1
        if number in win: # if the number is in the winning numbers continue
            numbers.append(number) 
        else:
            print "lose" # else quite while ahead
            break
        numbers.sort() 
        win.sort()
        ball=randrange(42)+1 #picks the powerball
        if ball == powerball:
            print "win"
            wins=wins+1
    count=count+1
print
print wins,"winners with", win, powerball


seeing as i have left the python mailing list in the past any comments or ideas would be appreciated if sent to this email - thank you
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to