example_list = [[‘this’, ‘is’], [‘a’, ‘test’]]
变成 This is a test
我只知道怎么连接 [‘this’, ‘is’, ‘a’, ‘test’] 这样子的 但是中间还有中括号
example_list = [[‘this’, ‘is’], [‘a’, ‘test’]]
变成 This is a test
我只知道怎么连接 [‘this’, ‘is’, ‘a’, ‘test’] 这样子的 但是中间还有中括号
s = " ".join([" ".join(x) for x in example_list])
你题目的解答代码如下:
example_list = [['this', 'is'], ['a', 'test']]
s = " ".join([" ".join(x) for x in example_list])
print(s)
如有帮助,请点击我的回答下方的【采纳该答案】按钮帮忙采纳下,谢谢!