Python provides many ways to create 2-dimensional lists/arrays. Each item of the list element gets printed line by line. Check prime number. We simply pass in the two arrays as arguments inside the add( ). The above example using the while loop and prints all the elements in the output. 💡 Tip: If you need to add the elements of a list or tuple as individual elements of the original list, you need to use the extend() method instead of append(). This is less like the for keyword in other programming languages, and works more like an iterator method as found in other object-orientated programming languages.. With the for loop we can execute a set of statements, once for each item in a list, tuple, set etc. If we want to remove the last element in a list/array we use a pop method. To add element in an existing array we can use append() method for adding the elements in python. Python Arrays – A Beginners Guide We can add an element to the end of the list or at any given index. But the sum() method is faster when you are handling huge lists of elements. There are ways to add elements from an iterable to the list. Python for loop would place 0(default-value) for every element in the array between the range specified in the range() function. [from Google's python style guide. To learn more about this, you can read my article: Python List Append VS Python List Extend – The Difference Explained with Array Method Examples. So when the loop condition i