哪个是将元组列表转换为字符串的最pythonic方式?
我有:
[(1,2), (3,4)]
Run Code Online (Sandbox Code Playgroud)
而且我要:
"(1,2), (3,4)"
Run Code Online (Sandbox Code Playgroud)
我的解决方案是:
l=[(1,2),(3,4)]
s=""
for t in l:
s += "(%s,%s)," % t
s = s[:-1]
Run Code Online (Sandbox Code Playgroud)
是否有更多的pythonic方式来做到这一点?