标签:code mod 遍历 color Dimension modified span original ons
4.5.1定义元祖
dimensions = (200, 5) print(dimensions[0]) print(dimensions[1])
200 5
4.5.2遍历元祖中的所有值
dimensions = (200, 5) for dimension in dimensions: print(dimension)
200 5
4.5.3修改元祖变量
dimensions = (200, 5) print("Original dimensions:") for dimension in dimensions: print(dimension) dimensions = (400, 100) print("\nModified dimensions:") for dimension in dimensions: print(dimension)
Original dimensions: 200 5 Modified dimensions: 400 100
标签:code mod 遍历 color Dimension modified span original ons
原文地址:https://www.cnblogs.com/yuxinjack/p/9848986.html