I've got this code:
Text = input("Copy Text here ")
WordList = Text.split(" ")
i = 0
for i in range (0, len(WordList)-1):
i += 1
while (i <= len(WordList)) :
if (WordList[i] == "Name" or "Name1" or "Name2") :
print(WordList[i])
else:
print("No DATA")
If I run this code I get two problems: first it only prints the last entry which might be because I forgot to tell it to stop counting when "Name", "Name2" or "Name1" is found. The bigger problem is that this ends in an infinite loop and I've got no idea why.