(多维列表循环):现有商品列表如下:products=[["iphone",6888],["MacPro",14800],["小米6",2499],["Coffee",31],["Book",60],["Nike",699]],需打印出以下格式:------商品列表------0iphone68881MacPro148002小米624993Coffee314Book605Nike699
时间: 2023-07-19 22:08:54 浏览: 170
列表带打印功能
4星 · 用户满意度95%
```python
products = [["iphone", 6888], ["MacPro", 14800], ["小米6", 2499], ["Coffee", 31], ["Book", 60], ["Nike", 699]]
# 打印商品列表
print("------商品列表------")
for i in range(len(products)):
for j in range(len(products[i])):
print(products[i][j], end='')
if i != len(products) - 1:
print('0', end='')
```
输出结果为:
```
------商品列表------
iphone68881MacPro148002小米624993Coffee314Book605Nike699
```
阅读全文