Code: Now, in Python lists article, let’s see how to add and delete elements in it. Adding Array Elements. While Loop Through Python List Variable to Print All Element. This kind of problem is quite common and can occur in day-day programming or web development. When we need to convert a string to list in Python containing the constituent strings of the parent string(previously separated by some separator like‘,’or space), we use this method to accomplish the task. In the above code: We consider a string, string1="Python is great" and try to convert the same a list of the constituent strings type() gives us the type of object passed to the method, which in our case was a string split() is basically used to split a string into a list on the basis of the given separator. insert () - inserts a single item at a given position of the list. When you need to add counters to an iterable, enumerate is usually the most elegant approach. insert(): inserts the object before the given index. The join() method is useful when you have a list of strings that need to be joined together into a single string value. Mul (*) operator to join lists. with the counters and returned object will be an enumerate. set.update(sequences) set.update (sequences) set.update (sequences) It accepts a single or multiple iterable sequences as arguments and adds all the elements in these sequences to the set. Python : Convert list of lists or nested list to flat list; 7 Ways to add all elements of list to set in python; Python : Check if a list contains all the elements of another list; Python : How to Merge / Join two or more lists; Check if all elements in a list are None in Python; Python : How to Sort a Dictionary by key or Value ? Please check your email for further instructions. Similar to the above program, we have the ability to create a program in Python to accept a list of strings from the user.