lundi 28 décembre 2020

Why is my code returning two results instead of one

I am writing a simple code for a password controller which should return false if the string contains less than 8 characters and false if the string contains 8 or more characters. but i am getting two response one is either true or false, and the other result is <function password at 0x00000272BA8B7F70>.

Here is the code I have written:

def password(str):
    if len(str) >= 8:
        print("true")
    else:
        print("false")
    return password
print(password("gtbd"))

Aucun commentaire:

Enregistrer un commentaire