【发布时间】:2021-03-31 23:47:32
【问题描述】:
我想制作一个程序,它可以打印出一条信息,然后打印出与第一个信息相关的另一条信息。我有一个清单:
householdDecor= ['Potted Plant', 24.00, 'Painting', 35.30, 'Vase', 15.48,
'Rug', 49.99, 'Fancy Bowl', 28.00]
我想要它,所以当我打印列表时,它会在每个数字之后移动到新行。所以它看起来像这样:
Potted Plant 24.00
Painting 35.30
Vase 15.48
Rug 49.99
Fancy Bowl 28.00
有什么方法可以做到这一点,而不是像你一样移动每个项目的行:print(householdDecor, sep = "\n")?
【问题讨论】: