fir3net
PPS-Firenetbanner-780.5x190-30-03-17

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

lotterynumbers.sort()
print lotterynumber

 

 

Tags: Python

About the Author

RDonato

R Donato

Rick Donato is the Founder and Chief Editor of Fir3net.com. He currently works as a Principal Network Security Engineer and has a keen interest in automation and the cloud.

You can find Rick on Twitter @f3lix001