how to check in str characters and not str or digit python code example Example: isdigit python s='12' s.isdigit()#returns True