当前位置:Gxlcms > Python > python语法棉花糖说明

python语法棉花糖说明

时间:2021-07-01 10:21:17 帮助过:180人阅读

快速创建list

>>> squares = [x**2 for x in range(1,10)]
>>> [n for n in range(1,100) if n%3==0]
>>> mybag = [' glass',' apple','green leaf ']
>>> [one.strip() for one in mybag]
>>> list(enumerate(mybag))

性能与空间

for key in _dict:
    pass

以上就是python语法棉花糖说明的详细内容,更多请关注Gxl网其它相关文章!

人气教程排行