Apr-10-2017, 04:51 PM
(This post was last modified: Apr-10-2017, 04:52 PM by ichabod801.)
This is incorrect:
if userin == 'i' or 'I': food_items(items)It will always evaluate to True. To do this correctly you can do:
if userin == 'i' or userin == 'I':or:
if userin in ('i', 'I'):Using the lower method is better when dealing with case insensitive searches. It is best to use lower once:
userin = input('blah blah blah').lower() if userin == 'i': ...
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures