String Validators

  • + 0 comments

    If you don't want to use any loop:

    import re
    s = input()
    print(True if re.findall('[a-zA-Z0-9]' , s) else False)
    print(True if re.findall('[a-zA-Z]' , s) else False)
    print(True if re.findall('[0-9]' , s) else False)
    print(True if re.findall('[a-z]' , s) else False)
    print(True if re.findall('[A-Z]' , s) else False)