a,b = 1,2 print(a,b) >>1 2
a,b = [1,2] print(a,b)>>1 2
a,b = [1,2],[3,4] print(a,b)>>[1,2] [3,4]
a = 1 b = 2 #一行代码互换 a, b = b,a
#列表查询a = [1,2,6,9] print(a[0:3:-1]) #没有返回值,不报错
原文地址:https://www.cnblogs.com/cgqForward/p/9484641.html
时间: 2024-10-10 09:59:37