Function returning True
if in position 4 the word contain T Y or R and position 5 I, M, or Z, False
if no match
def word():
if ["T,Y,R"] in (word[3]):
return True
if ["R,Y,F,M"] in (word[4]):
return True
else:
return False