转自:http://blog.csdn.net/sruru/article/details/7790436 以前没有深入考虑过raw_input与input函数的区别,所以一直比较困惑,今天测试之后,有了较为深入了解,记录如下 >>> user = raw_input("Enter your name:") Enter your name:scr >>> user 'scr' >>> user = raw_input("E…
问题:在Python2.7中使用 input() 函数会出现 “NameError: Name ”***“ is not defined 的错误 解决: 使用raw_input() 函数,在Python2.7版本中的input() 函数会自作聪明的将用户所输入的内容加以处理,比如输入字符串的时候会自动分析类型,输入1+2的时候会给出3的答案,解决的办法是使用raw_input()函数,可以保证用户输入的东西不被改变,在Python3以上的版本已经把这个傻逼函数取消了.…
Python 2.3.4 (#1, Feb 2 2005, 11:44:13) [GCC 3.4.3 20041212 (Red Hat 3.4.3-9.EL4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> user=raw_input("please input:&quo…