Python random while multiple conditions
<p>Cheers, my problem is that I don't know how to do a while with multiple conditions. I really don't get it why this won't work:</p>

<pre><code>import random

a = 0
b = 0
c = 0

while a &lt; 190 and b &lt; 140 and c &lt; 110: # &lt;-- This condition here
    a = 0
    b = 0
    c = 0

    for i in range(1, 465):
        v = random.randint(1, 3)

        if v == 1:
            a = a + 1
        elif v == 2:
            b = b + 1
        else:
            c = c + 1

    result = ""
    result += "a: " + str(a) + "\n"
    result += "b: " + str(b) + "\n"
    result += "c: " + str(c) + "\n"

    print (result)
</code></pre>

<p>I want to loop this until a is above 190 AND b above 140 AND c above 110 but it stops everytime after the first run.</p>

<p>Can someone help me there?</p>

<p>You are resetting <code>a</code>, <code>b</code> and <code>c</code> in the body of the loop.
Try this:</p>

<pre><code>&gt;&gt;&gt; count = 0
&gt;&gt;&gt; while a &lt; 190 and b &lt; 140 and c &lt; 110 and count &lt; 10: # &lt;-- This condition here
...   count += 1
...   a = 0
...   b = 0
...   c = 0
...   print(count, a, b, c)
... 
(1, 0, 0, 0)
(2, 0, 0, 0)
(3, 0, 0, 0)
(4, 0, 0, 0)
(5, 0, 0, 0)
(6, 0, 0, 0)
(7, 0, 0, 0)
(8, 0, 0, 0)
(9, 0, 0, 0)
(10, 0, 0, 0)
&gt;&gt;&gt; 
</code></pre>

python random multiple-conditions