15 of 30 Completed
Write a function to get a sample from a Bernoulli trial.
Input:
def bernoulli_sample(p): pass
Output:
1 with probability p or 0 with probability 1-p.
1
p
0
1-p
You have 15 sections remaining on this learning path.