摘要:
python中对二维列表进行转置 001、实现方法1:使用zip*解包和list函数 >>> list1 = [["aa", "bb", "cc"], [100, 300, 500], ["kk", "xx", "yy"], [88, 22, 33]] ## 测试列表 >>> list1 [['aa 阅读全文
posted @ 2025-07-16 09:06
小鲨鱼2018
阅读(29)
评论(0)
推荐(0)
摘要:
python中map函数的用法 001、批量转换数据类型 >>> str1 ## 测试字符串 '123456789' >>> for i in str1[5:]: ... print(i, type(i)) ... 6 <class 'str'> ## 迭代输出为字符型 7 <class 'str' 阅读全文
posted @ 2025-07-16 08:49
小鲨鱼2018
阅读(14)
评论(0)
推荐(0)
摘要:
001、 python中对列表进行排序,限定数值型: >>> list1 = [2,1,5,10,3,7] ## 测试列表1,数值型,可以直接排序 >>> sorted(list1) [1, 2, 3, 5, 7, 10] >>> list1 = ["2","1","5","10","3","7"] 阅读全文
posted @ 2025-07-16 08:46
小鲨鱼2018
阅读(4)
评论(0)
推荐(0)

浙公网安备 33010602011771号