-->

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