The objective of this program is to:
prompt user for number of items needed
read what items are needed
prompt user for number of items bought
read what items have been bought
Lastly, compare the two lists to see which items have been bought vs what unnecessary items have been bought.
i.e
"Here are the items you still need to buy: bread eggs eggs ham
Here are the unnecessary items you bought: chips turkey"
Here is my code thus far:
count = 1
count2 = 1
# of items on list
item_numN = int(raw_input("Please enter the number of items on your grocery list.\n"))
for i in range (0,item_numN):
item_list = str(raw_input("What is the item #" + str(count) + " on your list?\n"))
count = count + 1
# of items bought
item_numB = int(raw_input("Please enter the number of items you bought.\n"))
for i in range (0,item_numB):
item_bought = str(raw_input("What is the item #" + str(count2) + " that you bought?\n"))
count2 = count2 + 1
I can't quite figure out how to read the two separate sets of input and compare them. Any help would be greatly appreciated.