-
比较:a=[1,2,3]和b=[(1),(2),(3)] 以及c=[(1,),(2,),(3,)]的区别
a=[1,2,3] 是列表 b=[(1),(2),(3)] 是列表 c=[(1,),(2,),(3,)] 是元组列表
-
两个列表colors = [“balck”,“white”] sizes=[“S”,“M”,“L”],请严格按照顺序输出如下结果:
[(“balck”,“S”),(“white”,“S”),(“balck”,“M”),(“white”,“M”),(“balck”,“L”),(“white”,“L”)]colors = ["balck", "white"] sizes = ["S", "M", "L"] my_list = list() for i in sizes: for k in colors: my_list.append([k, i]) print(my_list)
python_test_12
猜你喜欢
转载自blog.csdn.net/weixin_44786482/article/details/89045007
今日推荐
周排行