How to set “end” paramters based on conditions inside print Python

前端 未结 0 443
庸人自扰
庸人自扰 2021-01-17 06:00

I want to print a list object with 5 items in a for loop, would like to print only the 3rd item(i.e. _ == 2) with new line while discarding newlines for other items.

相关标签:
回答
  • 消灭零回复
提交回复
热议问题