Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for House Password by vaibhavpunia007
# migrated from python 2.7
def checkio(data):
num_upper = 0 #number of uppercase letters
num_lower = 0 #number of lowercase letters
num = 0 #number of digits
for i in data: #for loop for every element in data
if i.isupper(): #if uppercase letter is there
num_upper += 1 #Increment by 1
if i.islower():
num_lower += 1
if i.isnumeric():
num += 1
return (len(data)>=10 and num_upper>0 and num_lower>0 and num>0) #return True if all conditions are satishfied
#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"
July 29, 2015
Comments: