• 0 Posts
  • 1 Comment
Joined 1Y ago
cake
Cake day: Aug 10, 2023

help-circle
rss

Don’t forget Python’s amazing list comprehension syntax!

guess = input(“Guess a letter:”).lower()
display = [ letter if letter == guess else “_” for letter in word ]

Just one part of your question, but it saves a lot of futzing around with indices and replaces.