Printing elements out of list

前端 未结 2 1740
你的背包
你的背包 2021-01-23 19:03

I have a certain check to be done and if the check satisfies, I want the result to be printed. Below is the code:

import string
import codecs
import sys
y=sys.ar         


        
2条回答
  •  爱一瞬间的悲伤
    2021-01-23 19:27

    To convert a list of strings to a single string with spaces in between the lists's items, use ' '.join(seq).

    >>> ' '.join(['1','2','3'])
    '1 2 3'
    

    You can replace ' ' with whatever string you want in between the items.

提交回复
热议问题