一种纯旧式的文字: “str” 对象,存储 bytes 。如果你使用一个 “u” 前缀,那么你会有一个“unicode”对象,存储的是code points。...对象和bytes对象可以使用.encode() (str -> bytes) or .decode() (bytes -> str)方法相互转化。...map>
>>> filter
>>>
它们输出的结果类型都是列表:
>>> map(lambda x:x *2, [1,2,3])
[2, 4,...6]
>>> filter(lambda x:x %2 ==0,range(10))
[0, 2, 4, 6, 8]
>>>
Python 3.x中它们却不是这个样子了:
>>> map
map'>
>>> map(lambda x:x *2, [1,2,3])
map at 0x10d7e32e8>
>>> filter
>>> filter(lambda