23 of 73 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 50 sections remaining on this learning path.