Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Python Program

Name: Anonymous 2011-11-21 10:39

Hey,
I posted this on /r/ a minute ago, and was redirected here. So...
I've been trying to code, with Python, a program that'd ask the user a password and close if the user gets the password wrong more than twice.
I've checked my version, corrected all the errors and didn't use objects cause I don't know how to use them. But the program won't work.
The program is here: http://pastebin.com/qEJSqCj1

If anyone here could help me in anyway possible, I'd really be glad.

TL;DR: Need help (correcting) on Python program, link is http://pastebin.com/qEJSqCj1

Name: Anonymous 2011-11-22 9:16

from getpass import getpass

CONF = {'password': 1234, 'tries': 3}

def try_pass():
    passwd = getpass('Password: ')
    try:
        passwd = int(passwd)
    except ValueError:
        return False
    else:
        if passwd is not CONF['password']
            return False
    return True


for try in tries:
    success = try_pass()
    if success:
        break

if success:
    print 'Very good!'
else:
    print 'OOOOOOOOO'

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List