String Validators

Sort by

recency

|

1886 Discussions

|

  • + 0 comments

    if name == 'main':

    s = input()
    
    
    print(any(c.isalnum() for c in s))
    
    
    print(any(c.isalpha() for c in s))
    
    
    print(any(c.isdigit() for c in s))
    
    
    print(any(c.islower() for c in s))
    
    
    print(any(c.isupper() for c in s))
    
  • + 0 comments

    if name == 'main': s = input() print(*[any(map(f, s)) for f in [str.isalnum, str.isalpha, str.isdigit, str.islower, str.isupper]], sep='\n')

  • + 0 comments
    def checkContent(string):
        print(any(i.isalnum() for i in string))
        print(any(i.isalpha() for i in string))
        print(any(i.isdigit() for i in string))
        print(any(i.islower() for i in string))
        print(any(i.isupper() for i in string))
    
    if __name__ == '__main__':
        s = input()
        checkContent(s)
    
  • + 0 comments

    Simple and easy to understand

    if __name__ == '__main__':
        s = input()
        for i in s:
            if i.isalnum():
                print(True)
                break
        else:
            print(False)
        for i in s:
            if i.isalpha():
                print(True)
                break
        else:
            print(False)
        for i in s:
            if i.isdigit():
                print(True)
                break
        else:
            print(False)
        for i in s:
            if i.islower():
                print(True)
                break
        else:
            print(False)
        for i in s:
            if i.isupper():
                print(True)
                break
        else:
            print(False)
    
  • + 0 comments

    Хотел тоже поделится своим решением:

    s = input() print(any([i.isalnum() for i in s])) print(any([i.isalpha() for i in s])) print(any([i.isdigit() for i in s])) print(any([i.islower() for i in s])) print(any([i.isupper() for i in s]))