unibiased flip: Find the probability of how many times heads and how many times tails
<p>i am trying to develop a function which prints the probability of heads given as number of times h was printed divided by total number of times h or t was printed. </p>

<p>Here's my code
def unbiasedFlip(n,p):</p>

<pre><code>for i in range(n+1):
    p=Pr(Heads)
    n=Totalflips
    if num1&gt;=p and num2&lt;p:
        print(Heads)
    elif num1&gt;=(1-p) and num2&lt;(1-p):
        print(Tails)
</code></pre>

<p>num1 and num2 are the two random numbers which are supposed to be generated through if function. and pr for probablity. when i run the program i get error that i am not defining pr or heads.</p>
