house_password   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 17
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 5

1 Function

Rating   Name   Duplication   Size   Complexity  
A checkio() 0 11 5
1
def checkio(data):
2
    has_numbers = {str(i) for i in range(0, 10)}.intersection(set(data))
3
    has_lower_chars = {chr(i) for i in range(ord('a'), ord('z') + 1)}.intersection(
4
        set(data)
5
    )
6
    has_upper_chars = {chr(i) for i in range(ord('A'), ord('Z') + 1)}.intersection(
7
        set(data)
8
    )
9
    if len(data) >= 10 and has_numbers and has_lower_chars and has_upper_chars:
10
        return True
11
    return False
12
13
14
if __name__ == '__main__':  # pragma: no cover
15
    # These "asserts" using only for self-checking and not necessary for
16
    # auto-testing
17
    assert checkio('A1213pokl') is False, "1st example"
18
    assert checkio('bAse730onE4') is True, "2nd example"
19
    assert checkio('asasasasasasasaas') is False, "3rd example"
20
    assert checkio('QWERTYqwerty') is False, "4th example"
21
    assert checkio('123456123456') is False, "5th example"
22
    assert checkio('QwErTy911poqqqq') is True, "6th example"
23