Jan-21-2018, 05:51 PM
That's code.I printed inventory but ı need in the question of 'What are you searching for:" when ı search juice program must give me only juices.How ı supply it ?
users={"meryem":"4444","ahmet":"sehir123"} login=raw_input("Username: ") if login in users: psw=raw_input('Password: ') if users[login]==psw: print('Successfully logged in!'),('\n'),"Welcome, meryem! Please choose one of the following options by entering the corresponding menu number." else: print('Your user name and/or password is not correct. Please try again!') else: print "Your user name and/or password is not correct. Please try again!" menu=True while menu: print (""" 1.Search for a product. 2.See Basket 3.Check Out 4.Logout 5.Exit """) answer = raw_input("Your choice: ") if answer=="1": inventory = {'asparagus': [10, 5], 'broccoli': [15, 6], 'carrots': [18, 7], 'apples': [20, 5], 'banana': [10, 8], 'berries': [30, 3], 'eggs': [50, 2], 'mixed fruit juice': [0, 8], 'fish sticks': [25, 12], 'ice cream': [32, 6], 'apple juice': [40, 7], 'orange juice': [30, 8], 'grape juice': [10, 9]} message3=raw_input("What are you searching for: ") for message3 in [inventory]: print(message3)