[Python] Checkio Solution 解答 – House Password




Stephan and Sophia forget about security and use simple passwords for everything. Help Nikola develop a password security check module. The password will be considered strong enough if its length is greater than or equal to 10 symbols, it has at least one digit, as well as containing one uppercase letter and one lowercase letter in it. The password contains only ASCII latin letters or digits.

Input: A password as a string (Unicode for python 2.7).

Output: Is the password safe or not as a boolean or any data type that can be converted and processed as a boolean. In the results you will see the converted results.

re.match(“[a-zA-Z0-9]+”, password)
0 < len(password) ≤ 64


Source: https://py.checkio.org

My Solution:


For what I remember, this should be the first time I used string module on Checkio. The solution is kind of long but it contains several similar function definitions, which make the following if statement easier to be handled.