Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Second attemp solution in Clear category for House Password by vyavorskyy
# migrated from python 2.7
def checkio(passwd):
#Check if password has not more than 10 and less than 64 symbols
if not 10 <= len(passwd) <= 64:
return False
#Check if password contains any uppercase symbol
elif not any(c.isupper() for c in passwd):
return False
#Check if password contains Unicode symbols
elif not any(isinstance(c, str) for c in passwd):
return False
#Check if password contains any lowercase symbol
elif not any(c.islower() for c in passwd):
return False
#Check if password contains any digit
elif not any(c.isdigit() for c in passwd):
return False
else:
return True
#replace this for solution
#return True or False
#Some hints
#Just check all conditions
if __name__ == '__main__':
#These "asserts" using only for self-checking and not necessary for auto-testing
assert checkio('A1213pokl') == False, "1st example"
assert checkio('bAse730onE4') == True, "2nd example"
assert checkio('asasasasasasasaas') == False, "3rd example"
assert checkio('QWERTYqwerty') == False, "4th example"
assert checkio('123456123456') == False, "5th example"
assert checkio('QwErTy911poqqqq') == True, "6th example"
Oct. 15, 2015
Comments: