Skip to content

Instantly share code, notes, and snippets.

@raresteak
Created August 8, 2023 00:22
Show Gist options
  • Save raresteak/7b4f50310f8ba1557b33831d6e6e895f to your computer and use it in GitHub Desktop.
Save raresteak/7b4f50310f8ba1557b33831d6e6e895f to your computer and use it in GitHub Desktop.
Python3 powerball lotto numbers generator
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