mardi 2 février 2016

Python GCSE homework help - password

For my homework I need to make a user registration system in python. I need to make a password section what I am meant to do. Here is my code and I cant work out whats wrong:

password = input("Please enter your password: ")
passwordl = len(password)
while passwordl <= 8:
    print("password must be more than 8 characters - please try agian")
    password = input("Please enter your password: ")
passworda = password.isalpha()
passwordi = password.isdigit()
while passworda != True or passwordi != True:
    print("password needs to contain digits and characters - please re-enter")
    password = input("Please enter your password: ")

The code is in a function btw.

Thanks

Aucun commentaire:

Enregistrer un commentaire