isdigit() 是字符串的一个方法,用来判断这个字符串是否是纯数字的字符串

In [1]: str = 'hello'

In [2]: str.isdigit()
Out[2]: False
In [3]: str = '123'

In [4]: str.isdigit()
Out[4]: True

 

 

 

 

    

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-19
  • 2022-12-23
  • 2021-08-19
猜你喜欢
  • 2021-07-05
  • 2021-06-24
  • 2021-12-14
  • 2022-12-23
  • 2021-08-26
  • 2021-12-13
  • 2022-12-23
相关资源
相似解决方案