def substitute(clues,words):
subst_words = [] # <== HERE
for i in range(len(words)):
word = words[i]
for j in range(len(clues)):
word = word.replace(clues[j][1],clues[j][0])
subst_words.append(word)
return subst_words
Why is subst_words assigned to an empty pair of brackets before use? Stupid question I know but I am unsure...
Additionally how would I apply a Tuple in substitution of a list, if at all possible?