Python convert tuple to string

后端 未结 4 537
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-27 15:01

I have a tuple of characters like such:

(\'a\', \'b\', \'c\', \'d\', \'g\', \'x\', \'r\', \'e\')

How do I convert it to a string so that it

4条回答
  •  无人及你
    2020-11-27 15:41

    here is an easy way to use join.

    ''.join(('a', 'b', 'c', 'd', 'g', 'x', 'r', 'e'))
    

提交回复
热议问题