yes/no input loop, issues with with correct looping
<p>I'm programming  a short guessing game. But, I have no idea how prevent incorrect input (yes/no), preventing user to go forward. Here's a WORKING code. Tried with while True but it only messes the input even more. The furthest is that else, that notifies the player, but the q count move forward. </p>

<pre><code># -*- coding: cp1250 -*-

import sys

def genVprasanja ():

    yes = set(['yes','y', ''])
    no  = set(['no','n'])
    testQ = ['hello1', 'hello33112', 'hello332', 'hello2', 'hello4','hellomore', 'ANSWER', 'hello1', 'hello33112', 'hello332', 'hello2', 'hello4','hellomore', 'ANSWER2', 'hello1', 'hello33112', 'hello332', 'hello2', 'hello4','hellomore', 'ANSWER3'] 
    points = 5
    total = 0
    for x in range(0,3):
        for y in xrange(len(testQ)):
            reply = str(raw_input('\n'+str(abs(y-5))+ ' - ' +  testQ[y]+' (y/n) --&gt; ')).lower().strip()
            if reply in yes:
                print '\ncorect!\n\nAnswer is :',testQ[5], '\n\nPoints: ',points, '\n'
                total = total + points
                print 'Total: ', total, '\n'
                break                    
            elif reply in no:
                points = points - 1      
                if points !=  0:     
                    print '\nwrong!', '\n\nNext question for: ',points                                     
                else:
                    print '\nThe end!\n\n' 'Every anwser is wrong!\n\nYou got 0 points.\n\Correct answer is:', testQ[5],'\n\n'
                    total = total + points
                    print 'SKUPNE TOÄKE: ', total
                    break
            else:
                sys.stdout.write("\nPlease press 'RETURN' or 'N'\n")
    points = 5
genVprasanja()
</code></pre>

<p>Edit:</p>

<p>Every player gets to answer three sets of 5 questions. They receive questions until they say yes. If they say no 5 times the loop ends (3x times) - I'm using <code>var points</code> to count. </p>

<p>But if they input and incorrect words (not no and not yes) the input question repeats itself asking them again (until they enter a valid answer). After that they get THE SAME question they failed to validly answer.</p>

<p><code>while True:</code> will work, you need to <code>break</code> out of the loop once the conditions have been met.</p>

<pre><code>while True:
    reply = str(raw_input('\n' + str(abs(y - 5)) + ' - ' + testQ[y] + ' (y/n) --&gt; ')).lower().strip()
    if reply in yes or reply in no:
            break
</code></pre>

<p>Based on the updated scope, try this, it seems the <code>break</code> may have caused you issues:</p>

<pre><code>reply = False
while reply not in yes and reply not in no:
    reply = str(raw_input('\n' + str(abs(y - 5)) + ' - ' + testQ[y] + ' (y/n) --&gt; ')).lower().strip()
</code></pre>

python loops