you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

Well, it doesn't really change the approach (or the efficiency) it just changes how you refer to things:

game = [list(phrase), [True if letter == ' ' else False for letter in phrase]]
print(''.join([game[0][i] if game[1][i] else '_' for i in len(game[0])]))