Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Hangman Game
#2
if correct_guess == False:
Better:
if not correct_guess:
referring to line 69 and some following lines:
word_list = ["aardvark", "baboon", "camel", "jazz", "grass", "follow", "castle", "cloud"]
I would always write global variables in uppercase like WORD_LIST instead of word_list

i would use more comments. While writing simple scripts its not really necessary, it can help a lot in the future if you just used to comment your code. I am a huge fan of purpose statements

blank = ""
for letter in chosen_word:
    blank += "_"
blank_list = list(blank)
you can just write:
blank = "_" * len(chosen_word)
If you are only coding for weeks this is pretty good btw
Reply


Messages In This Thread
Hangman Game - by monkeydesu - Sep-21-2022, 03:26 AM
RE: Hangman Game - by coffeejunkie34 - Sep-28-2023, 12:14 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Hangman game- feedback please NV12 1 2,136 Apr-08-2020, 09:14 PM
Last Post: micseydel

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020