Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (50.2k points)
Can anyone tell me how to append list in Python?

1 Answer

0 votes
by (108k points)

If you want to add any element in a list in Python, then you have to use the append() function.

fruits = ['apple', 'banana', 'cherry']

fruits.append("orange")

The output:

[‘apple’,’banana’,’cherry’,’orange’]

If you are looking for an online course to learn Python, I recommend this Python Training program by Intellipaat.

Browse Categories

...