[snip]
Since you look up the items in the grocery list it seems to me a
dictionary relating each item to its aisle would be best.
inventory = {"chips" : 1, "bread" : 1, "pretzels" : 1, "magazines" : 1,
"juice" : 2, "ice cream" : 2,
"asparagus" : 3}
MAX_AISLE = 3
aisle
On 07/14/2010 11:57 PM, Eric Hamiter wrote:
Last question (for today, at least): Right now, the output is less
than aesthetically pleasing:
(['Located on aisle 1: ', 'bread', 'magazines'], ['Located on aisle 2:
', 'juice', 'ice cream'], ['Located on aisle 3: ', 'asparagus'], ['Not
found in the d
Eric Hamiter wrote on 07/14/2010 04:57:57 PM:
> Thanks for the pointers! This is now working, albeit probably ugly and
clunky:
>
>
> aisle_one = ["chips", "bread", "pretzels", "magazines"]
> aisle_two = ["juice", "ice cream"]
> aisle_three = ["asparagus"]
>
> def find_groceries():
> with o
Thanks for the pointers! This is now working, albeit probably ugly and clunky:
aisle_one = ["chips", "bread", "pretzels", "magazines"]
aisle_two = ["juice", "ice cream"]
aisle_three = ["asparagus"]
def find_groceries():
with open("grocery_list.txt") as grocery_list:
first_trip = ["L
"Eric Hamiter" wrote
aisle_one = ["chips", "bread", "pretzels", "magazines"]
aisle_two = ["juice", "ice cream"]
aisle_three = ["asparagus"]
def find_groceries():
grocery_list = open("grocery_list.txt", "r")
for line in grocery_list.readlines():
See previous about removing the redundan