关于Python的变量,我就说一句话
在多年开发和教学 Python 的过程中,有一个 bug,出现的频率非常高,经常有人会踩坑:
person = {'name': '', 'id': }
team = []
for i in range(3):
x = person
x['id'] = i
team.append(x)
team[]['name'] = 'Jack'
team[1]['name'] = 'Pony'
team[2]['name'] = 'Crossin'
print(team[1])
相关文章