对象.isdigit() ,只能判断全是数字的字符串时间:2023-12-09 15:11:31s = "55p"" print(s.isdigit()) # False s2 = "5568" print(s2.isdigit()) # True