Created
May 23, 2023 13:30
-
-
Save bbelderbos/5d6c26651b26e781c974db193c367df6 to your computer and use it in GitHub Desktop.
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 csv | |
import random | |
DATA = "MOCK_DATA.csv" | |
def get_emails(data=DATA): | |
with open(data) as f: | |
reader = csv.reader(f) | |
next(reader) | |
emails = [row[3] for row in reader] | |
return emails | |
def get_random_emails(emails, number_emails=3): | |
return random.sample(emails, k=number_emails) | |
if __name__ == "__main__": | |
all_emails = get_emails() | |
rand_emails = get_random_emails(all_emails) | |
print(rand_emails) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment