Skip to content

Instantly share code, notes, and snippets.

@Oiselenjakhian
Created August 15, 2020 10:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Oiselenjakhian/26a7336a19a7cd1136dea3eec4b67cc8 to your computer and use it in GitHub Desktop.
Save Oiselenjakhian/26a7336a19a7cd1136dea3eec4b67cc8 to your computer and use it in GitHub Desktop.
Creating a Lottery Simulator Using the Python Programming Language
# Import the randint function
from random import randint
# Initialize the empty list
pickedNumbers = []
# Generate numbers from 1 to 36 6 times
while(len(pickedNumbers) < 6):
generated = randint(1, 36)
if (generated not in pickedNumbers):
pickedNumbers.append(generated)
# Print out the numbers in the list
print(pickedNumbers[0])
print(pickedNumbers[1])
print(pickedNumbers[2])
print(pickedNumbers[3])
print(pickedNumbers[4])
print(pickedNumbers[5])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment