Created
August 15, 2020 10:07
-
-
Save Oiselenjakhian/26a7336a19a7cd1136dea3eec4b67cc8 to your computer and use it in GitHub Desktop.
Creating a Lottery Simulator Using the Python Programming Language
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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