How to append multiple values to a list in Python

前端 未结 4 2018
醉梦人生
醉梦人生 2020-11-30 17:35

I am trying to figure out how to append multiple values to a list in Python. I know there are few methods to do so, such as manually input the values, or put the append oper

4条回答
  •  忘掉有多难
    2020-11-30 18:26

    If you take a look at the official docs, you'll see right below append, extend. That's what your looking for.

    There's also itertools.chain if you are more interested in efficient iteration than ending up with a fully populated data structure.

提交回复
热议问题