food simulation
Why this error accured
try to input 1 then input 1-11
LINE 187
If you live in the USA and are a panda express restaurants customer, then you should try this panda express survey at https://pandaexpresscomfeedbackss.com/ and win a meal for free. We all know that panda express restaurant is very famous for its fast-food items.
buy = food[int(bu_y)]
@Dunce it still error
@AbdullaAl5 Can I see the error message you're getting?
@AbdullaAl5 if I'm deciphering your code correctly, you're trying to grab the index of where every the string that matches bu_y is, but bu_y is a string, so it can't be used as an index, however there are other ways of doing this, here is an example:
for i in range(len(food)): if food[i] == bu_y: buy = i
i think you have to convert it to an integer using int(bu_y)
@BananaJellyfish it still error
i think the error is because
bu_y
is not an integer indice. You should only put integers as[]
.@RYANTADIPARTHI it still error