I was coding a discord bot and realized I had difficulty parsing messages. I ended up using a double for loop (yuck). What can I do to optimize this code? (this is a far more straightforward version of the code)
string = "His name is food"
list = ["food", "numbers"]
parsed_string = string.split(" ")
print(parced_string)
for i in parsed_string:
for x in list:
if i == x:
print("stop")
How do I optimize this bit of code?