如何在Python中将多个列表合并为一个列表? [英] How to merge multiple lists into one list in python?

查看:720
本文介绍了如何在Python中将多个列表合并为一个列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
从以下列表中的列表中删除一个列表Python
将列表列表一起合并到一个列表中Python

Possible Duplicate:
Making a flat list out of list of lists in Python
Join a list of lists together into one list in Python

我有很多看起来像

['it']
['was']
['annoying']

我希望上面的样子

['it', 'was', 'annoying']

我该如何实现?

推荐答案

只需添加它们:

['it'] + ['was'] + ['annoying']

您应该阅读 Python教程,以学习类似的基本信息.

You should read the Python tutorial to learn basic info like this.

这篇关于如何在Python中将多个列表合并为一个列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆