[Solved] python code for power ball lottery [closed]


import random as r

def Powerball():
    result = []
    for i in range(5):
        number = r.randint(1,69)
        while (number in result):
            number = r.randint(1,69)
        result.append(number)
    result.sort()
    result.append(r.randint(1,26))
    return result

if __name__ == '__main__':
    result = Powerball()        
    print result

This code returns first five unique random numbers from 1 to 69 in ascending order followed by a random number form 1 to 26.

2

solved python code for power ball lottery [closed]