Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for House Password by Kurush
# migrated from python 2.7
def checkio(data):
Condition1 = (len(data) >= 10)
Condition2 = False
Condition3 = False
Condition4 = False
for c in data:
if c.isdigit():
Condition2 = True
if c.islower():
Condition3 = True
if c.isupper():
Condition4 = True
return Condition1 and Condition2 and Condition3 and Condition4
'Return True if password strong and False if not'
if __name__ == '__main__':
assert checkio('A1213pokl')==False, 'First'
assert checkio('bAse730onE4')==True, 'Second'
assert checkio('asasasasasasasaas')==False, 'Third'
assert checkio('QWERTYqwerty')==False, 'Fourth'
assert checkio('123456123456')==False, 'Fifth'
assert checkio('QwErTy911poqqqq')==True, 'Sixth'
print('All ok')
March 8, 2013