In this Python list program, we will take a user input as a list and split a given list into two parts where the length of the first part of the list is given with the help of the below-given steps.
Split the list into two parts:
Steps to solve the program
- Take a list as input.
- Create an empty list.
- Split the given list into two parts where the length of the first part is given using indexing.
- Add those parts to the empty list.
- Print the list to see the output.
Output :
Related Articles
Python program to insert items at a specific position in the list.
Python program to select random numbers from the list.
Python program to create a 3*3 grid with numbers.
Python program to zip two lists of lists into a list.
Python program to convert the first and last letter of each item from Upper case and lowercase.
Python to find maximum and minimum values in the given heterogeneous list.