Created
August 8, 2023 00:22
-
-
Save raresteak/7b4f50310f8ba1557b33831d6e6e895f to your computer and use it in GitHub Desktop.
Python3 powerball lotto numbers generator
This file contains hidden or 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 secrets | |
numbers = [] | |
while len(numbers) < 5: | |
n = secrets.choice(range(1, 69)) | |
if n not in numbers: | |
numbers.append(n) | |
numbers.sort() | |
powerBall = secrets.choice(range(1, 26)) | |
print(*numbers, sep=", ", end='') | |
print(" PowerBall", powerBall) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment