Skip to content

Commit

Permalink
rename for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
mircealungu committed Oct 4, 2024
1 parent 26d1e01 commit 34117f3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions zeeguu/core/exercises/similar_words.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
)


def similar_words(word, language, user, words_to_sample=2):
def similar_words(word, language, user, number_of_words_to_return=2):

words_the_user_must_study = user.scheduled_bookmarks(10)

Expand All @@ -22,8 +22,8 @@ def similar_words(word, language, user, words_to_sample=2):
)
candidates_filtered = [w for w in candidates_filtered if len(w) > 1]

random_sample = random.sample(candidates_filtered, words_to_sample)
random_sample = random.sample(candidates_filtered, number_of_words_to_return)
while word in random_sample:
random_sample = random.sample(candidates_filtered, words_to_sample)
random_sample = random.sample(candidates_filtered, number_of_words_to_return)

return random_sample

0 comments on commit 34117f3

Please sign in to comment.