|
发表于 2017-7-26 17:19:25
|
显示全部楼层
请问你用的Python3还是2呢?
我是2版本,所以出现的这个问题,并且我发现当我输入的名字是中文或是英文时,报的错还不一样。
我输入lxh时候出现这样的错误:
- 请输入你的姓名:lxh
- Traceback (most recent call last):
- File "D:\Python\code\little game class two\homework_hello.py", line 2, in <module>
- temp = input("请输入你的姓名:")
- File "<string>", line 1, in <module>
- NameError: name 'lxh' is not defined
复制代码
输入中文后出现这个错误:
- 请输入你的姓名:李学汉
- Traceback (most recent call last):
- File "D:\Python\code\little game class two\homework_hello.py", line 2, in <module>
- temp = input("请输入你的姓名:")
- File "<string>", line 1
- 李学汉
- ^
- SyntaxError: invalid syntax
复制代码
能帮忙解答一下吗?
感谢!! |
|