I'm new to python, and while I was looking at a course, I had an idea of something I'm not finding a solution for :
proteins = ["venison", "tuna", "chicken"]
veggies = ["kale", "spinach", "tomatoes"]
for i in proteins:
for j in veggies:
if j == "spinach":
print("Spinach?!? Feed it to the dog")
print(i,j)
print(type(j))
Result :
venison kale
Spinach?!? Feed it to the dog
venison spinach
venison tomatoes
tuna kale
Spinach?!? Feed it to the dog
tuna spinach
tuna tomatoes
chicken kale
Spinach?!? Feed it to the dog
chicken spinach
chicken tomatoes
My intent is to, instead of printing "Venison Spinach..." and meat and spinach, really, is to have the sentence ("Spinach?!? Feed it to the dog") instead of printing the "menu".
The idea I have is then,
Whenever j==spinach
we
print("Spinach?!? Feed it to the dog")
and here we go to the next index before
print(i,j)
.
How can I do this?
Hope my question makes sense! Thank you,