String Validators

  • + 0 comments

    Took a litle resrearch to find out the correct way :v

    Need to use any() function (built-in) that returns True if at least one element in an iterable is True

    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))