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 | Print all the common elements of two lists
- Python | Get positive elements from given list of lists
- Python | Count of common elements in the 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
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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