saving . . . saved How to add multiple elements in a list has been deleted. How to add multiple elements in a list has been hidden .
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 01-06-20, 9:41 a.m. Chasta

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]


01-06-20, 11:02 a.m. ankitrj.iitb
01-06-20, 11:10 a.m. Chasta
Thanks
01-06-20, 11:10 a.m. Chasta

Login to add comment


Log-in to answer to this question.