📌  相关文章
📜  python 检查输入是否为数字 - Python 代码示例

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

代码示例3
whatever = input("Pick an integer > ")
try:
    whatever_as_an_integer = int(whatever)
       print("That was an integer.")

except ValueError:
    print("That is not an integer.")