) #结果为:CHI
3.语法:
3.1 去除了,改用!...__init__(a) #无参数调用super()
3.8 改变了顺序操作符的行为,例如x<y,当x和y类型不匹配时抛出
TypeError而不是返回随即的bool值
#python2
>>> 2<"4..."
True
#python3
>>> 2<"4"
Traceback (most recent call last):
File "", line 1, in
TypeError...'bytes'>
str对象和bytes对象可以使用.encode()(str->bytes) or .decode()(bytes->str)方法相互转化
6.面向对象
引入抽象基类
7.异常...,必须显调用
#python2
>>> list(xrange(5))
[0, 1, 2, 3, 4]
#python3
>>> list(range(5))
[0, 1, 2, 3, 4]
8.2