if isdigit python test for string code example Example: isdigit python s='12' s.isdigit()#returns True