How to add multiple elements in a list
Title
Question
How can we add multiple elements in a list because append function can add one element at a time
Python-3.4.3 Getting-started-with-Lists 08-09 min 0-10 sec
Answers:
Just make a list out of those elements and add them to the original list;
elem = [11, 22, 33] # multiple elements that need to be added
orig_list = [9, 8, 7] # original list
added_list = orig_list + elem # Result is: [9, 8, 7, 11, 22, 33]
Login to add comment