String Validators

  • + 1 comment
    has_alphanumeric, has_alphabetical, has_digits, has_lowercase, has_uppercase = False, False, False, False, False
    for char in input().strip():
        if char.isalnum():
            has_alphanumeric = True
        if char.isalpha():
            has_alphabetical = True
        if char.isdigit():
            has_digits = True
        if char.islower():
            has_lowercase = True
        if char.isupper():
            has_uppercase = True
    
    print(f'{has_alphanumeric}\n{has_alphabetical}\n{has_digits}\n{has_lowercase}\n{has_uppercase}')