Last active
August 29, 2015 14:05
-
-
Save bordy/813c35ce36737f4719b4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__ = 'bordy' | |
def checkio(data): | |
if (len(data)<10) or (data==data.upper()) or (data==data.lower()): | |
return False | |
else: | |
digits = [i for i in data if i in [str(x) for x in range(10)]] | |
if digits == []: | |
return False | |
else: | |
return True | |
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" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment