Python List Exercise
Last Updated :
13 Dec, 2024
Improve
List Operations
- Access List Item
- Change List item
- Replace Values in a List in Python
- Append Items to a list
- Insert Items to a list
- Extend Items to a list
- Remove Item from a list
- Clear entire list
Basic List programs
- Maximum of two numbers
- Ways to find length of list
- Minimum of two numbers
- To interchange first and last elements in a list
- To swap two elements in a list
- to check if element exists in list
- Reversing a List
- Cloning or Copying a list
- Count occurrences of an element in a list
- find sum and average of List in Python
- Sum of number digits in List
- Multiply all numbers in the list
- find smallest number in a list
- find largest number in a list
- find second largest number in a list
- print even numbers in a list
- print odd numbers in a List
- to count Even and Odd numbers in a List
- to print positive numbers in a list
- to print negative numbers in a list
- to count positive and negative numbers in a list
- Remove multiple elements from a list
- Remove empty tuples from a list
- Program to print duplicates from a list of integers
- Remove first element from list
- To remove duplicates from list
- Get unique values from a list
- Merge Two lists
- Iterate over a list
- Find average of a list
- Perform append at beginning of list
- To find second largest number in a list
- Intersection Of two lists
- Select random value from a list
- Check if two lists are identical
- Get the last element of list
- Remove None values from list
- Print all common elements of two lists
- Maximum and minimum element's position in a list
- Union of two or more lists
Programs on List of Strings
- Swap elements in String list
- To Convert a List to String
- to reverse All Strings in String List
- to find the character position of Kth word from a list of strings
- Extract words starting with K in String List
- Prefix frequency in string List
- Split String of list on K character
- Split Strings on Prefix Occurrence
- Remove words containing list characters
- Ways to remove multiple empty spaces from string List
- Add Space between Potential Words
- Convert Character Matrix to single String
- Filter the List of String whose index in second List contains the given Substring
- to Replace all Characters of a List Except the given character
- Converting all Strings in a list to integers in Python
- Convert a String Representation of a List into a List
Programs on List of Lists
- Remove empty List from List
- Convert List to List of dictionaries
- Convert Lists of List to Dictionary
- Uncommon elements in Lists of List
- to select Random value from list of lists
- Reverse Row sort in Lists of List
- Pair elements with Rear element in Matrix Row
Programs on SubString and SubLists
- Count Strings with substring String List
- Test if Substring occurs in specific position
- Replace Substrings from String List
- Remove Reduntant Substrings from Strings List
- Group Sublists by another List
- Sort String by Custom Integer Substrings
- Finding strings with given substring in list
- Remove all values from a list present in another list
- Print all sublists of a list in Python
Advance List Programs
- Count unique values inside a list
- List product excluding duplicates
- Extract elements with Frequency greater than K
- Test if List contains elements in Range
- Check if the list contains three consecutive common numbers
- Find the Strongest Neighbour
- Print all Possible Combinations from the three Digits
- Find all the Combinations in the list with the given condition
- Get all unique combinations of two Lists
- Remove all the occurrences of an element from a list
- Remove Consecutive K element records
- Replace index elements with elements in Other List
- Retain records with N occurrences of K
- Sort the list according to the column using lambda
- Create list of numbers with given range
- Check if a given object is A list or Not
- Break a list into chunks of size N
- Get last N elements from given list
- Get all unique combinations of two lists