main_site = ['mayo', 'ketchup', 'mustard', 'milk', 'eggs'] off_site = ['cocoa', 'flour', 'salt', 'bread', 'butter'] purchases = ['ketchup', 'mustard', 'bread', 'butter'] for purchase in purchases: if purchase in main_site or purchase in off_site: print("That item is in stock!") if purchase in main_site: print("The item can be picked up today." if purchase in off_site: print("The item can be delivered in two to five days.") else: print("Sorry, that item is not in stock." print("We hope you purchase from us again!")It seems to me like it should work. It points to line 10 "if purchase in off_site:" with a syntax error. I don't see it though.
Am I not allowed to use multiple if statements in sequence?
Nevermind. I just noticed I missed some parentheses in a different line.
The program ran when I added the parentheses.
Why didn't it point to the broken print statement though? It pointed to the line below it.