I wrote below code to use binomial distribution CDF (by using scipy.stats.binom.cdf) to estimate the probability of having NO MORE THAN k heads out of 100 tosses, where k = 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100.
and then I tried to plot it using hist()
.
import scipy
import matplotlib.pyplot as plt
def binomcdf():p = 0.5n = 100x = 0for a in range(10):print(scipy.stats.binom.cdf(x, n, p))x += 10plt.hist(binomcdf())
plt.show()
but I don't know why my plot returns empty, and I receive below error, can anyone help please!
TypeError: 'NoneType' object is not iterable