[ create a new paste ] login | about

Link: http://codepad.org/FHHAx0yw    [ raw code | fork ]

rautamiekka - Python, pasted on Jul 18:
while 1:
    try:
        chao = raw_input("would you like to adopt a chao or get an egg? type egg/adopt ")
    except ValueError:
        continue
    except KeyboardInterrupt:
        exit()

    if chao.lower() not in ("egg","adopt"):
        continue

    break

'''The below is exactly the same but with the §else§ parts.'''
while 1:
    try:
        chao = raw_input("would you like to adopt a chao or get an egg? type egg/adopt ")
    except ValueError:
        continue
    except KeyboardInterrupt:
        exit()
    else:
        if chao.lower() not in ("egg","adopt"):
            continue
        else:
            break


Create a new paste based on this one


Comments: