列表推导式(list comprehension)

Python2:

>>> x = 'my homie'
>>> dummy = [x for x in 'ABC']
>>> x
'C'

Python3:

Python2中的列表推导式存在变量泄漏问题,在Python3中不存在-LMLPHP

05-11 22:34