Exercise 6: Compute the Probability of X given the Breed -> 𝑃(π‘₯βˆ£πΆπ‘–)

my function of pmf_binomial(x, n, p) worked fine in previous exercise where the input x is just an integer. But now in this exercise 6, where the input X is a list, how do i modify the function to make it work here? This is the error i got:
β€”> 15 {moderator edit: code removed}
** 16 ### END CODE HERE ###**
** 18 return pmf**

TypeError: unsupported operand type(s) for -: β€˜int’ and β€˜list’

I recommend using the .pmf method of binom(n, p).