In [34]: net_ip
Out[34]: ['61.xxx.56.226']
In [35]: net_ip[0].isdigit()
Out[35]: False
In [36]: net_ip[0][0].isdigit()
Out[36]: True
In [34]: net_ip
Out[34]: ['61.xxx.56.226']
In [35]: net_ip[0].isdigit()
Out[35]: False
In [36]: net_ip[0][0].isdigit()
Out[36]: True
本文标题:python 判断是否为数字
本文链接:https://www.haomeiwen.com/subject/smndoqtx.html
网友评论