## Powerball Lotto

This is the place for queries that don't fit in any of the other categories.

### Powerball Lotto

I seem to be getting errors, anyone fill me in?
Code: Select all
`from random import randintdef BubbleSort(l):    e=0    for i in range(len(l)-1):        for j in range(len(l)-1):            if l[j]>l[j+1]:                e=l[j+1]                l[j+1]=l[j]                l[j]=e    return ldef MyPrint(L,pb):        BubbleSort(L)        print "Your numbers: %d %d %d %d %d Powerball: %d"%(L[0],L[1],L[2],L[3],L[4],pb)print "Powerball number generator"No=int(raw_input("How many sets of numbers? "))for i in range(No):    numbers=[]    powerball=randint(1,42)    i=0    while (i!=5):        numbers.append(randint(1,53))        i+=1    for i in range(len(numbers)-1):        for j in range(len(numbers)-1):            if i==j:                j+=1            if numbers[i]==numbers[j] or powerball==numbers[j]:                numbers[j]=randint(1,53)                j-=1    MyPrint(numbers,powerball)`
PC Specs:

i5 4670K @ 4.1Ghz
8GB Corsair Vengance RAM
Gigabyte Z87-HD3
1TB S-ATAIII 6.0Gb/s
NVIDIA GeForce GTX 760 2GB
Zalman Z11 Case
Corsair 550W PSU

Posts: 8
Joined: Sat Nov 16, 2013 12:48 pm

### Re: Powerball Lotto

AdamLandau wrote:I seem to be getting errors, anyone fill me in?

What kind of errors?
Friendship is magic!

R.I.P. Tracy M. You will be missed.

stranac

Posts: 1790
Joined: Thu Feb 07, 2013 3:42 pm

### Re: Powerball Lotto

stranac wrote:
AdamLandau wrote:I seem to be getting errors, anyone fill me in?

What kind of errors?

Fixed thanks!
PC Specs:

i5 4670K @ 4.1Ghz
8GB Corsair Vengance RAM
Gigabyte Z87-HD3
1TB S-ATAIII 6.0Gb/s
NVIDIA GeForce GTX 760 2GB
Zalman Z11 Case
Corsair 550W PSU

Posts: 8
Joined: Sat Nov 16, 2013 12:48 pm

### Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 5 guests