How to append multiple values to a list in Python

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 pur the append operation in a for loop, or appendand extend functions.

However, I wonder if there is a more neat way to do so? Maybe a certain package or function?

I am day 1 to Python, so please forgive me if I asked naive question.

Thank you very much. :)

You can use the sequence method list.extend to extend the list by multiple values from any kind of iterable, being it another list or any other thing that provides a sequence of values.

    >>> lst = [1, 2]
    >>> lst.append(3)
    >>> lst.append(4)
    >>> lst
    [1, 2, 3, 4]

    >>> lst.extend([5, 6, 7])
    >>> lst.extend((8, 9, 10))
    >>> lst
    [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

    >>> lst.extend(range(11, 14))
    >>> lst
    [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]

So you can use list.append() to append a single value, and list.extend() to append multiple values.

From: stackoverflow.com/q/20196159