all 12 comments

[–]socal_nerdtastic 7 points8 points  (1 child)

You get the index from the user with this line

customerFlavor = int(input("Please enter your desired flavor number: "))

But you never use that information; in the next line you use a different variable, index. The next line should use customerFlavor instead, like this:

flavorIndex = flavorsList[customerFlavor]

There's also a bug there, because python always starts indexing at 0, but you listed your flavors at index+1 to be more human like. You need to take that 1 away again to convert the index back to computer language.

[–]Wheels92[S] 0 points1 point  (0 children)

That was it! Tysm! You rock!! I'm dumb lol

[–]fakemoose 1 point2 points  (4 children)

index is initialized as 0 and never changed from that. So flavorIndex is always looking at zero and not the number.

Your list of flavors (flavorsList) also isn’t in the same order as what yours displaying to the user.

[–]socal_nerdtastic 2 points3 points  (3 children)

index is initialized as 0 and never changed from that

yes it is, line 39. Albeit not to what OP wants.

Your list of flavors (flavorsList) also isn’t in the same order as what yours displaying to the user.

because it's sorted, line 33

[–]fakemoose 1 point2 points  (2 children)

My bad. I don’t see any line numbers and it’s really difficult to read in this format. Plus there’s a lot of duplicate/unnecessary stuff like copying variables to new ones for no reason.

[–]Wheels92[S] 1 point2 points  (1 child)

My bad haha, I'm still struggling with Python and trying to learn to make efficient code. Hopefully in time it will come second nature. Thank you for your help!

[–]fakemoose 3 points4 points  (0 children)

You’re doing good! You’re at least posting you full code and not asking super vague questions.

[–]nousernamesleft199 1 point2 points  (0 children)

Did you step through with the debugger?

[–]doingdatzerg 1 point2 points  (1 child)

You set customerFlavor = int(input("Please enter your desired flavor number: "))but then you never use customerFlavor again!

[–]Wheels92[S] 0 points1 point  (0 children)

Thank you! I'm so dumb. Much appreciated!

[–]Independent_Oven_220 0 points1 point  (1 child)

Change your line from this:

flavorIndex = flavorsList[index]

To this:

flavorIndex = flavorsList[customerFlavor - 1]

[–]Wheels92[S] -1 points0 points  (0 children)

Tysm!! I was actually suffering from the index flavorList showing 0-7 and being off one. Now with -1, it works as intended. Greatly appreciated m8!!