我今天刚学python,发现书跟编译器跟不上啊,感觉到问题了,求各位指教,谢谢
用的python版本是3.3.0的
a=1;b=2;
if a>b:
print("1")
elif a<b:#输入到这里,回车就出问题了
$ python
Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> a = 1
>>> b = 2
>>> if a > b:
... print("1")
... elif a < b:
... pirnt("2")
...
Traceback (most recent call last):
File "<stdin>", line 4, in <module>
NameError: name 'pirnt' is not defined
>>> if a > b:
... print("1")
... elif a < b:
... print("2")
...
2
>>> s=input(':')
:123
>>> type(s)
<class 'str'>