how to check if a char in python is a digit code example Example: isdigit python s='12' s.isdigit()#returns True