May-11-2018, 05:39 AM
The printing the shared positions is outside the if block. It will print all word_1 letters and their positions because it executes at every iteration.
if range(l_word_1) == range(l_word_2)
could be like this if l_word_1 == l_word_2