Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Amethyst Sarah Watkins #131

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

Sarahwatkinsdev
Copy link

No description provided.

Comment on lines +11 to +16
while len(hold_letters) < 10:
letter = random.choice(list(letter_pool.keys()))

if letter_pool[letter] > 0:
hold_letters.append(letter)
letter_pool[letter] -= 1

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we want to make sure that we are making a list of letters we the appropriate weights (if we have "A": 4 then that should correspond to ["A', "A", "A", "A"]. We could do some with an implementation could look something like this:

letters = []
for letter in LETTER_POOL: # this will give us the keys
   letters += letter * LETTER_POOL[letter]

then we could get our 10 like so:

 hold_letters = random.sample(letters, 10)   

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants