how to use .isdigit python code example Example 1: isdigit python s='12' s.isdigit()#returns True Example 2: python isdigit my_char.isdigit()