📜  python 测试字符串是否为 int - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:31.295000             🧑  作者: Mango

代码示例2
def RepresentsInt(s):
    try: 
        int(s)
        return True
    except ValueError:
        return False