92 of 257 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 165 sections remaining on this learning path.