#1
import numpy as np
import numpy.random as rd

#2
def unlancer(p):
    x = rd.random()
    if x <= p: 
        return(1)
    else:
        return(0)

#test
for k in range(1,11): 
    print(unlancer(0.75))

x = unlancer(p)
l1 = 1
y = unlancer(p)
while y == x :
    l1 = l1 + 1
    y = unlancer(p)
l2 =  0
while y != x : 
    l2 = l2 + 1
    y = unlancer(p)

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: