the302storm the302storm - 18 days ago 6
Python Question

When to use append?

I've recently started programming in Python 3.5.2 (I learned C++ about three years ago but I haven't put that to use since then) and I can't understand the function of
'.append()'

Maybe the problem is that I'm not a native english speaker.

Can someone explain this concept to me?

Answer

You have a list for example [1, 2, 3] If you want to add another element use append:

list = [1, 2, 3]
list.append(4)
Comments