File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ def checkio (data : str ) -> bool :
2+ if len (data ) < 10 :
3+ return False
4+ if not data .isalnum ():
5+ return False
6+ x = 0
7+ for i in data :
8+ if i .isdigit ():
9+ x = 1
10+ y = 0
11+ for i in data :
12+ if 97 <= ord (i ) <= 122 :
13+ y = 1
14+ z = 0
15+ for i in data :
16+ if 65 <= ord (i ) <= 90 :
17+ z = 1
18+ if x == 1 and y == 1 and z == 1 :
19+ return True
20+ else :
21+ return False
22+
23+
24+ # Some hints
25+ # Just check all conditions
26+
27+
28+ if __name__ == '__main__' :
29+ # These "asserts" using only for self-checking and not necessary for auto-testing
30+ assert checkio ('A1213pokl' ) == False , "1st example"
31+ assert checkio ('bAse730onE4' ) == True , "2nd example"
32+ assert checkio ('asasasasasasasaas' ) == False , "3rd example"
33+ assert checkio ('QWERTYqwerty' ) == False , "4th example"
34+ assert checkio ('123456123456' ) == False , "5th example"
35+ assert checkio ('QwErTy911poqqqq' ) == True , "6th example"
36+ print ("Coding complete? Click 'Check' to review your tests and earn cool rewards!" )
You can’t perform that action at this time.
0 commit comments