在python中很有趣的现象如下数组:
a=[2,0,3]
b=a
del b[1]
print(b,a)
输出结果:
[2, 3] [2, 3]
这个说明python在进行删除操作时会将与删除元素相关数组的元素同样进行删除,可以采用deepcopy来进行赋值以避免此情况。
import copy
a=[2,0,3]
b=deepcopy()
del b[0]
print(b,a)
输出结果:
[0,3],[2,0,3]
SQL数据字段查询:
select * from sys.tables a join sys.all_columns b on b.object_id=a.object_id
2020-10-23
最新推荐文章于 2022-02-19 16:45:22 发布