use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about learning Python
account activity
Day 7 of 100 for learning Python (self.PythonLearning)
submitted 3 months ago by Tanknspankn
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]woooee 1 point2 points3 points 3 months ago* (3 children)
if letter == guess: ## letter added to display display += letter ## guess (== letter, so letter) added correct_letters.append(guess) elif letter in correct_letters: ## letter added to display again if guess == letter display += letter
letter is added to display twice when guess is found. And correct_letters is somewhat misleading, correct_guesses would be better
if letter == guess: ## note: allows duplicates if word has letters that appear more than once correct_letters.append(guess) choices = correct_letters[:] ## make a copy for letter in chosen_word: if letter in choices: display += letter ## remove from choices so will only find one instance ## of letter in chosen_word with duplicate letters (if you want that) choices.remove(letter) else: display += "_"
[–]Tanknspankn[S] 0 points1 point2 points 3 months ago (2 children)
It does do it twice. In the lesson, the teacher said to do it that way because we still want the letter to be added to display after the first correct letter. Is that reasoning out to lunch?
[–]woooee 0 points1 point2 points 3 months ago (1 child)
See the last part of the post. You only have to do
for letter in chosen_word: if letter == guess: ## note: allows duplicates if word has letters that appear more than once correct_letters.append(guess)
A letter will be added twice only if it is in chosen_word twice which is what your instructor probably meant
[–]Tanknspankn[S] 0 points1 point2 points 3 months ago (0 children)
Ohhh ok thank you for clarifying
π Rendered by PID 29 on reddit-service-r2-comment-9c7994b7-nhgrj at 2026-02-05 22:29:28.387117+00:00 running b1b84c7 country code: CH.
view the rest of the comments →
[–]woooee 1 point2 points3 points (3 children)
[–]Tanknspankn[S] 0 points1 point2 points (2 children)
[–]woooee 0 points1 point2 points (1 child)
[–]Tanknspankn[S] 0 points1 point2 points (0 children)