[Tutor] Question

APQ LE apqle75 at hotmail.com
Mon Mar 15 19:39:09 EST 2004


what does 'retries' mean in this example?

def ask_ok(prompt, retries=4, complaint='Yes or no, please!'):
    while True:
        ok = raw_input(prompt)
        if ok in ('y', 'ye', 'yes'): return True
        if ok in ('n', 'no', 'nop', 'nope'): return False
        retries = retries - 1
        if retries < 0: raise IOError, 'refusenik user'
        print complaint

_________________________________________________________________
Find things fast with the new MSN Toolbar – includes FREE pop-up blocking! 
http://clk.atdmt.com/AVE/go/onm00200414ave/direct/01/




More information about the Tutor mailing list