string validators hackerrank solution

Solutions on MaxInterview for string validators hackerrank solution by the best coders in the world

showing results for - "string validators hackerrank solution"
Nicole
10 Apr 2020
1if __name__ == '__main__':
2    s = input()
3    print(any(i.isalnum() for i in s))
4    print(any(i.isalpha() for i in s))
5    print(any(i.isdigit() for i in s))
6    print(any(i.islower() for i in s))
7    print(any(i.isupper() for i in s))
8
9#The any() function returns True if any item in an iterable are true,
10#otherwise it returns False.
11#If the iterable object is empty, the any() function will return False.
Yoan
17 Jan 2019
1if __name__ == '__main__':
2    s = input()
3    print(any(a.isalnum() for a in s) )
4    print(any(a.isalpha() for a in s) )
5    print(any(a.isdigit() for a in s) )
6    print(any(a.islower() for a in s) )
7    print(any(a.isupper() for a in s) )