1.显示的错误
message = input("Tell me something, and I will repeat it back to you: ")
File "", line 1, in
NameError: name 'Hello' is not defined
2.出错的代码
message = input("Tell me something, and I will repeat it back to you: ")
print(message)
3.解决方法:
**在python2.x版本中,不能用input()函数,而是用raw_input()**
所以下面的代码是可以正确运行的
message = raw_input("Tell me something, and I will repeat it back to you: ")
print(message)
4.运行结果
5.《Python编程:从入门到实践》截图
6.《Python编程:从入门到实践》文字版电子书资源
链接:https://pan.baidu.com/s/17kLEl6VDkVQ-n8B6BqV39Q
提取码:1hav