-->

String Validators in Python - Hacker Rank Solution | Apna Hindi Tech


String Validators in Python - Hacker Rank Solution
String Validators



Hello Friends 

рдЖрдЬ рд╣рдо рдЖрдкрдХреЛ Hacker Rank рдкрд░ String Validators рдХрд╛ рдХрдВрдкреНрд▓реАрдЯ рд╕реЙрд▓реНрдпреВрд╢рди рдмрддрд╛рдПрдВрдЧреЗ рд╡рд╣ рднреА рдЖрд╕рд╛рди рднрд╛рд╖рд╛ рдореЗрдВред рддреЛ рджреЛрд╕реНрддреЛрдВ рдЪрд▓рд┐рдП рдЬрд╛рдирддреЗ рд╣реИрдВ рд╕реЙрд▓реНрдпреВрд╢рди ред



Problem:- String Validators




Task :-

You are given a string S.

Your task is to find out if the string S contains: alphanumeric characters, alphabetical characters, digits, lowercase and uppercase characters.



Input Format :-

A single line containing a string S.


Constraints :-

0<len(s)<1000



Output Format :-

In the first line, print True if S has any alphanumeric characters. Otherwise, print False.

In the second line, print True if S has any alphabetical characters. Otherwise, print False.

In the third line, print True if S has any digits. Otherwise, print False.

In the fourth line, print True if S has any lowercase characters. Otherwise, print False.

In the fifth line, print True if S has any uppercase characters. Otherwise, print False.



Sample Input :-

qA2


Sample Output :-


True
True
True
True
True



Solution :-


if __name__ == '__main__':
    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]))


    



Video Tutorial :-









 Related Posts









DISCLAIMER:-
The above hole problem statement is given by hackerrank.com but the solution is generated by the  Apna Hindi Tech authority if any of the query regarding this post or website fill the following contact form.

......Thank YouЁЯШК......


рдпрд╣ рднреА рдкрдврд╝реЗрдВ

Post a Comment