|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x

temp = input("请输入您的名字:")
name = int(temp)
print("你好,name!")
跑起来是这样
Python 3.9.1 (tags/v3.9.1:1e5d33e, Dec 7 2020, 17:08:21) [MSC v.1927 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>>
==================== RESTART: C:/Users/24077/Desktop/回复姓名.py ===================
请输入您的名字:小甲鱼
Traceback (most recent call last):
File "C:/Users/24077/Desktop/回复姓名.py", line 2, in <module>
name = int(temp)
ValueError: invalid literal for int() with base 10: '小甲鱼'
|
|