mardi 8 septembre 2020

New if function for passwords

For my new study i need to make a new function new_password() that has 2 parameters: oldpassword and newpassword. the return-value needs to be True when the password meets the requirements. The new password is only accepted when it is different compared to the old one and contains 6 characters at minimum. If not the return value needs to be False.

I am completely new to python so any help will be appreciated. This is what i got so far:

def new_password(oldpassword,newpassword):
    if(oldpassword == newpassword and newpassword < 6):
        return false
    else:
        return true

Aucun commentaire:

Enregistrer un commentaire