Last active
July 4, 2023 16:49
-
-
Save akiraaisha/ec543a81bdfb356bce32a7a6494f61d1 to your computer and use it in GitHub Desktop.
Lotto 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 random | |
import datetime | |
import argparse | |
parser = argparse.ArgumentParser(description='This is a simple Lottery Generator for PCSO.\n') | |
parser.add_argument('--num', type=int, default=3, | |
help='Enter how many Lucky Numbers to generate.') | |
parser.add_argument('--max', type=int, default=49, | |
help='Enter the maximum range of the numbers.') | |
parser.add_argument('--com', type=int, default=6, | |
help='Enter how many combinations.') | |
parser.add_argument('--start', type=int, default=1, | |
help='Starting range.') | |
args = parser.parse_args() | |
low = args.start | |
high = args.max | |
cols = args.com | |
rows = args.num | |
Date = datetime.datetime.now() | |
GenDate = Date.strftime("%B %d, %Y, %T") | |
DateCreation = "Date Generated: " + GenDate + "\n" + "Your Lucky Pick for: " \ | |
+ str(cols) + "/" + str(high) | |
print(DateCreation) | |
RandomList = [sorted(random.sample(range(low, high), cols)) for _ in range(rows)] | |
for row in RandomList: | |
print(*row, sep=' ') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment