Lists: Creation, indexing, slicing, methods (append(), pop(), sort()), intro to list comprehension
- Write a Python program to create a list of five student marks and display the list ?
- Write a Python program to display the first and last elements of a list using indexing ?
- Write a Python program to find the length of a list ?
- Write a Python program to extract the first three elements using list slicing ?
- Write a Python program to add a new subject to a subject list using append() ?
- Write a Python program to remove the last element from a list using pop() ?
- Write a Python program to sort a list of numbers in ascending order ?
- Write a Python program to find the largest and smallest elements in a list ?
- Write a Python program to count even numbers in a list ?
- Write a Python program to reverse a list using slicing ?
- Write a Python program to swap the first and last elements of a list ?
- Write a Python program to create a list of squares using list comprehension ?
- Write a Python program to create a list containing only positive numbers from a given list using list
comprehension ? - Write a Python program to display alternate elements of a list using slicing ?
- Write a Python program to find the sum of all elements in a list ?
- Write a Python program to create a 3×3 matrix using nested list comprehensions ?
- Write a Python program to generate a list of student grades using list comprehension and conditional
expressions ? - Write a Python program to merge two lists and sort the resulting list ?
- Write a Python program to create a multiplication table list using list comprehension ?
- Write a Python program to identify all prime numbers from a given list ?