Pythonic way to print list items

后端 未结 11 1208
渐次进展
渐次进展 2020-11-22 10:29

I would like to know if there is a better way to print all objects in a Python list than this :

myList = [Person(\"Foo\"), Person(\"Bar\")]
print(\"\\n\".joi         


        
11条回答
  •  闹比i
    闹比i (楼主)
    2020-11-22 11:26

    [print(a) for a in list] will give a bunch of None types at the end though it prints out all the items

提交回复
热议问题