Suggested solution:
word_list = [ 'doctor', 'food', 'fruit', 'pond', 'felt', 'don' ]
pattern = 'epfdoctlz'
for word in word_list:
find = True
for letter in word:
if letter not in pattern:
find = False
break
if find == True:
print(F'The letters of {word} are all in {pattern}')
[edit]
A better implementation, taking advantage of the Python
else
clause that can be bound to a loop statement:
word_list = [ 'doctor', 'food', 'fruit', 'pond', 'felt', 'don' ]
pattern = 'epfdoctlz'
for word in word_list:
for letter in word:
if letter not in pattern:
break
else:
print(F'The letters of {word} are all in {pattern}')
[/edit]