dimanche 27 mars 2016

Basic if statement not working correctly [duplicate]

This question already has an answer here:

I'm new to python so don't judge too harshly. I have researched this for a couple hours but I haven't gotten were I want too.

results = {}
counter = 1
pastabake = "Pastabake recipie:"
pittapizzas = "Pitta Pizzas recipie:"

while True:
    response = input("Which ingredients do you have?");
    results[counter] = response
    counter +=  1
    if counter == 6:
        break
    if response == ('pasta' and 'onion' and 'cheese' and 'garlic'):
        print(pastabake)

What is happening is that once I run it, It only takes the prints pastabake once I type in the last response, which is "garlic", instead of taking all of them in any order before printing pastabake.

I don't understand what im doing wrong? Any help appreciated, Thanks.

Aucun commentaire:

Enregistrer un commentaire