Printing a list using python

前端 未结 4 452
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-11 21:27

I have a list compiled from excel cells, using python - say listlist. Each element in the cell/list is in unicode. When I print the list as

pri         


        
4条回答
  •  一生所求
    2020-12-11 22:18

    This is because print list is equivalent to

    print "[", ", ".join(repr(i) for i in list), "]"
    

    repr(s) is u"blabla" for a unicode string while print s prints only blabla.

提交回复
热议问题