随笔分类 - Python
摘要:python基础 , list,tuple,dict,set比较 1.list :list是一种有序的集合,可以随时添加和删除其中的元素。用len()函数可以获得list元素的个数.list是一个可变的有序表 >>> classmates = ['Michael', 'Bob', 'Tracy']
阅读全文
摘要:一、列表生成式 [ x**2 for x in range(1,11)] [生成式(要生成的元素) for循环] [ m+n for m in 'adf' for n in 'wer'] 运算式 for循环 for循环 [ s for s in L1 if isinstance(s,str)] 条件
阅读全文
浙公网安备 33010602011771号