Home »
Python »
Python NumPy MCQs
Observe the code and identify the outcome (5)
14. Observe the code and identify the outcome:
from numpy import random
x = random.binomial(n=100, p=0.5, size=10)
print(x)
- [41 53 50 52 60 47 50 50 50 46]
- [50 52 60 47 50 50 50 46]
- [41 53 50 52 60 47 50]
- None of the mentioned above
Answer: A) [41 53 50 52 60 47 50 50 50 46]
Explanation:
In the above code, binomial distribution has been used so the outcome of the code will be [41 53 50 52 60 47 50 50 50 46].