I made a very simple called Hangman
and i have been trying to use .start()
and .end()
functions to get all the matches of user input.These functions return a tuple. for example;
text = 'test'hidden_word = list('_'*len(text))for m in re.finditer('t', text): print('t found', m.start(), m.end())
Output >
('t found', 0, 1)
('t found', 3, 4)
My question is >how do I select items from the returned tuple?
.start()[1] Gives TypeError: 'int' object has no attribute '__getitem__'