Selecting multiple elements from array python
<p>this is a pretty basic question but here goes:</p>

<p>I would like to create an array and then would like to compare a user input to those elements within the array.</p>

<p>If one element is matched then function 1 would run. If two elements were matched in the array the an alternative function would run and so on and so forth.</p>

<p>Currently i can only use an IF statement with no links to the array as follows:</p>

<pre><code>def stroganoff():
    print ("You have chosen beef stroganoff")
    return

def beef_and_ale_pie():
    print ("You have chosen a beef and ale pie")
    return

def beef_burger():
    print ("You have chosen a beef burger")
    return

ingredients = ['beef','mushrooms','ale','onions','steak','burger']

beef = input("Please enter your preferred ingredients ")

if "beef" in beef and "mushrooms" in beef:
    stroganoff()
elif "beef" in beef and "ale" in beef:
    beef_and_ale_pie()
elif "beef" in beef and "burger" in beef:
    beef_burger()
</code></pre>

<p>As said, this is basic stuff for some of you but thank you for looking!</p>

<p>Since you only can work with IF statements </p>

<pre><code>beef=input().split()
#this splits all the characters when they're space separated
#and makes a list of them
</code></pre>

<p>you can use your <code>"beef" in beef and "mushrooms" in beef</code> and it should run as you expected it to</p>

python arrays python-3.x