From 34117f36ee3d71aa63a7366e32687df8cbc01b59 Mon Sep 17 00:00:00 2001 From: Mircea Filip Lungu Date: Fri, 4 Oct 2024 20:59:42 +0200 Subject: [PATCH] rename for clarity --- zeeguu/core/exercises/similar_words.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zeeguu/core/exercises/similar_words.py b/zeeguu/core/exercises/similar_words.py index b11a69f4..c953875a 100644 --- a/zeeguu/core/exercises/similar_words.py +++ b/zeeguu/core/exercises/similar_words.py @@ -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) @@ -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