Snowman Feedback - Jesica Guallpa#4
Conversation
yangashley
left a comment
There was a problem hiding this comment.
Nice job! Please review my comments, and let me know if you have any questions.
|
|
||
| if is_word_guessed(snowman_word,correct_letter_guess_statuses): | ||
| print_word_progress_string(snowman_word, correct_letter_guess_statuses) | ||
| print("Congratsm you win!") |
There was a problem hiding this comment.
Typo
| print("Congratsm you win!") | |
| print("Congrats you win!") |
|
|
||
| while len(wrong_guesses_list) < SNOWMAN_MAX_WRONG_GUESSES: | ||
| print_word_progress_string(snowman_word, correct_letter_guess_statuses) | ||
| print("Wrong guesses so far:", wrong_guesses_list) |
There was a problem hiding this comment.
👍 Nice job showing the player their incorrect guesses
| while len(wrong_guesses_list) < SNOWMAN_MAX_WRONG_GUESSES: | ||
| print_word_progress_string(snowman_word, correct_letter_guess_statuses) | ||
| print("Wrong guesses so far:", wrong_guesses_list) | ||
| print_snowman_graphic(len(wrong_guesses_list)) |
There was a problem hiding this comment.
👍 Nice job using finding the length of wrong_guesses_list and passing that value to print_snowman_graphic. Doing so means you don't need to create an unnecessary variable like wrong_guesses_count that would need to be manually incremented (which would be a place that a bug could get introduced).
| if user_guess in correct_letter_guess_statuses: | ||
| correct_letter_guess_statuses[user_guess] = True | ||
| print(f"Good Job! '{user_guess}' is in the word. \n ") | ||
|
|
There was a problem hiding this comment.
I'd argue you don't need this blank line on line 34 because we don't need it to visually/logically separate the code on lines 31-33 and lines 35-37.
Avoid adding unnecessary blank lines to your project because it makes your codebase longer and doesn't comply with the PEP8 style guide.
The guide says "Surround top-level function and class definitions with two blank lines." and "Extra blank lines may be used (sparingly) to separate groups of related functions."
Review the style guide recommendations on blank lines here.
| if is_word_guessed(snowman_word,correct_letter_guess_statuses): | ||
| print_word_progress_string(snowman_word, correct_letter_guess_statuses) | ||
| print("Congratsm you win!") | ||
| return |
There was a problem hiding this comment.
A return statement in Python stops the execution of code. I'm wondering if you can think of another way the logic could be written so that you can end the game without needing to use return (or a break statement) to break the loop?
This isn't a requirement, but if you'd like more practice with writing conditional logic in Python, I'd suggest thinking through and re-writing the logic so you don't need return to stop the game.
If you choose to do so, there's no need for you to submit anything to me for re-review. This would just be for your own practice 😊
|
|
||
|
|
There was a problem hiding this comment.
Remove unnecessary blank lines from the function and don't forget to remove the pass keyword (line 47) from a function when you're done writing the implementation. "The pass statement is used as a placeholder for future code. When the pass statement is executed, nothing happens, but you avoid getting an error when empty code is not allowed. Empty code is not allowed in loops, function definitions, class definitions, or in if statements."
Read more about pass here.
No description provided.