摘要: 深浅copy 1、赋值,二者分隔不开,list改list2也跟着该,因为指向的就是同一个地址 list1=[ 'sa', 'xx', [1,2] ] list2=list1 # 这不叫copy list1[0]='SA' print(list2) print(id(list1)) print(id( 阅读全文
posted @ 2020-03-09 23:23 灑 阅读(223) 评论(0) 推荐(0) 编辑
摘要: 1. 使用while循环输出1 2 3 4 5 6 8 9 10 count = 1 while count < 11: if count == 7: count += 1 continue print(count) count += 1 2. 求1-100的所有数的和 count = 0 sum 阅读全文
posted @ 2020-03-09 22:08 灑 阅读(351) 评论(0) 推荐(0) 编辑