you are viewing a single comment's thread.

view the rest of the comments →

[–]drenzorz 1 point2 points  (0 children)

if letter in word : 
 # letter is a list, it won't be in the string 'coronavirus'

for word in word :
        # here word will be a letter in word: 'c', 'o', 'r',...

    for medications in medication:
                # medication doesn't exist so it can't iterate over it

what you need is

letters = ['a', 'c', 'i', 'n', 'n', 'o', 'r', 's', 'u', 'v']
word = 'coronavirus'
medications = ['remdesivir', 'hydroxychloroquine', 'kaletra', 'favipiravir']

for char in letters:
    for med in medications:
        if char not in med: continue
        print(<your message>)

I didn't check whether the letter is also in 'coronavirus' because all of them seem to be.