Python 字典操作:修改立方体属性
cube = { 'length': 40, 'width': 40, 'height': 40 } cube['color'] = 'red' del cube['height'] cube['width'] = 20
print(cube) # 输出:{'length': 40, 'width': 20, 'color': 'red'}
原文地址: http://www.cveoy.top/t/topic/n0kG 著作权归作者所有。请勿转载和采集!
安全问答是一个知识全球问答,包含丰富的问答知识
cube = { 'length': 40, 'width': 40, 'height': 40 } cube['color'] = 'red' del cube['height'] cube['width'] = 20
print(cube) # 输出:{'length': 40, 'width': 20, 'color': 'red'}
原文地址: http://www.cveoy.top/t/topic/n0kG 著作权归作者所有。请勿转载和采集!