In this program, a list is accepted with the mixture of odd and even elements and based on whether the element is even or odd, it is split into two different lists.
Input : [8, 12, 15, 9, 3, 11, 26, 23] Output : Even lists: [8, 12, 26] Odd lists: [15, 9, 3, 11, 23] Input : [2, 5, 13, 17, 51, 62, 73, 84, 95] Output : Even lists: [2, 62, 84] Odd lists: [5, 13, 17, 51, 73, 95]
Even lists: [2, 62, 84] Odd lists: [5, 13, 17, 51, 73, 95]
- Python | Split list into lists by particular value
- Python | Split nested list into two lists
- Python | Split dictionary of lists to list of dictionaries
- Python | Split dictionary keys and values into separate lists
- Python | Split K elements after every N values
- Python | Split strings in list with same prefix in all elements
- Python | Pandas Split strings into two List/Columns using str.split()
- Python | Get positive elements from given list of lists
- Python | Print all the common elements of two lists
- Python | Find common elements in list of lists
- Python | Convert column to separate elements in list of lists
- Python program to find common elements in three lists using sets
- Python | Sorting list of lists with similar list elements
- Python | Merge List with common elements in a List of Lists
- Python | Program to count number of lists in a list of lists
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : shubham_singh