I was trying to write the opening blanks for a hangman game. My code was:
display = []
for x in (word):
display = display + "_"
print(display)
I understand that here, python thinks I'm trying to numerically add _
to a list object, which is not possible, but why is it that display += "_"
works fine?