Sunday 15 January 2012

python - Checking elements in the list -



python - Checking elements in the list -

i've spend few hours solving problem programme doesn't work (syntax error). cheking reply similar question didn't help. what's wrong code below? want chek if list (password) contains @ to the lowest degree 1 digit, containing 1 uppercase letter , 1 lowercase letter in it. please, provide me simplest way, i'm beginner ...

def checkio(password): array = list(password) #for letter in array: if len(array) < 10 or len(array) > 64: homecoming false if (any(l.isdigit() l in array) , (any(l.isupper( l in array) , (any(l.islower l in array): homecoming true else: homecoming false

your parentheses wrong. seek this.

def checkio(password): array = list(password) #for letter in array: if len(array) < 10 or len(array) > 64: homecoming false if ((any(l.isdigit() l in array)) , (any(l.isupper() l in array)) , ((any(l.islower() l in array)))): homecoming true else: homecoming false

python list element contain

No comments:

Post a Comment