对象.isdigit() ,只能判断全是数字的字符串

s = "55p""

print(s.isdigit())    # False

s2 = "5568"

print(s2.isdigit())    # True

猜你喜欢

转载自www.cnblogs.com/jack20181017/p/9900180.html