我很清楚,这是一个noob问题,但我似乎找不到解决方案,我很新编程但渴望学习。我正在浏览python中的第一个google clases,这是我得到的错误。名称未定义错误
def both_ends(s):
print s[0:2], s[3:5]
return
x = input('...: ')
both_ends(x)
[email protected]:~/Desktop/p2$ python test2.py
...: haloj
Traceback (most recent call last):
File "test2.py", line 10, in <module>
x = input('...: ')
File "<string>", line 1, in <module>
NameError: name 'haloj' is not defined
请解释一下问题所在。
谢谢
谢谢你,这解决了我的问题,并帮助我理解它。 – Sergei 2012-02-16 17:10:05