Python module returning True
<p>I'm writing Python for a kind of computer, and the login module always returns true, even if it's not in the <code>users</code> dictionary:</p>

<pre><code>cur_user = "null"
users = {
    "Splavacado100": "20310"
}

def login():
    good_login = 0
    user_name = raw_input("Enter your username: ")
    for user in users:
        if user == user_name:
            good_login = 1
    if good_login == 1:
        user_password = raw_input("Enter your password: ")
        if users[user_name] == user_password:
            return True
        else:
            return False
    else:
        return "None"

def OS():
    log_att = False
    log_att = login()
    if log_att:
        print "True"
    else:
        print "False"

OS()
</code></pre>

<p>How can I make it return false in those cases?</p>

<p>I am using Python 2.7.10.</p>

<p>Instead of returning "None", return None (as "None" is always true as it is a non-zero value).</p>

python python-2.7