Python - Lottery Number Generator

Below is a very small and basic lottery number generating program. Designed to purley show a working example of the random function.

import random
lotterynumbers = []
x = 0

while x < 6:
    lotterynumbers.append(random.randint(1, 49))
    x += 1

print lotterynumber



Tags: Python

About the Author


R Donato

Rick Donato is the Founder and Chief Editor of He currently works as an SDN/NFV Solutions Architect and has a keen interest in automation and the cloud.

You can find Rick on Twitter @f3lix001