Function to return True if integer k and n in list?
<p>Very new to python... If I give a list that has two integers n and k, the function should return Boolean True. K has to be in the list the number of n times. For example, if I call matchingValues([1, 2, 1, 4, 1, 1], 1, 4) should return True since 1 is in the list 4 times. I'm guessing I have to use the .count() option but not sure how to write it... Wish I could give more code but unfortunately I am very lost</p>

<pre><code>    def matchingValues(aList,n,k):
</code></pre>

<p>Better than a solution involving <code>len()</code> is to use the <code>.count()</code> method for lists. It takes an argument, and returns the number of times that argument appears in the list that it is called on.</p>

python list