while (d != "Pasta" or "pasta" or "Pizza" or "pizza" or "Burger" or "burger" or "Shawarma" or "shawarma"):
That statement will never fail because each expression after
or
is a non-zero value so will always be true. You must use complete expressions in every case. You also need to use
and
rather than
or
so all conditions are tested.
while (d != "Pasta" and d != "pasta" and d != "Pizza" and d != "pizza" and d != "Burger" and d != "burger" and d != "Shawarma" and d != "shawarma"):
You may also like to use a counter so the user cannot enter thousands of invalid words.
[edit]
A better test would be to use the
lower
method so you only need four tests:
while (d.lower() != "pasta" and d.lower() != "pizza" and d.lower() != "burger" and d.lower() != "shawarma"):
[/edit]