如何检测字符串中只含有数字?

s1 = "12223".isdigit()
print(s1)

s2 = "12223a".isdigit()
print(s2)

#结果如下:
#True
#False

猜你喜欢

转载自blog.csdn.net/Da___Vinci/article/details/92805370