Variables in a list

2019-06-19 20:04栏目:技术创新
TAG: 澳门葡

X = [1, 2, 3]
L = ['a', X, 'b']            # embed references to X's object
D = {'x':X, 'y':2}

X[1] = 'surprise'            # changes all three references!

print L

print D

版权声明:本文由新浦京娱乐站_新浦京娱乐场官网_新浦京娱乐发布于技术创新,转载请注明出处:Variables in a list