String Validators

  • + 0 comments

    using gettattribute()

    if __name__ == '__main__':
        s = input()
        str_arr = list(s)
        operations = ['isalnum','isalpha','isdigit','islower','isupper']
        mp={}
        for op in operations:
            mp[op]=False
        
        for char in str_arr:
            for op in operations:
                if getattr(char,op)() is True :
                    mp[op]=True
        for op in operations:
            print(mp[op])