HackerRank String Validators Problem Solution

HackerRank String Validators Problem Solution

Instructor-svgAl-Mamun Sarkar
Mar 23 , 2020

HackerRank String Validators Problem Solution. Use of isalnum(), isalpha(), isdigit(), islower(), isupper() functions of string.

Code: 

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


Test Input:

qA2

Test Output:

True
True
True
True
True
  • Share On:
  • fb
  • twitter
  • pinterest
  • instagram