Question 1 Lists Membership

Check if Country Belongs to BRICS List

Write a Python program to initialize a list containing the names of BRICS countries, accept a country name from the user, and verify whether it is part of BRICS.

Solution Code Screenshot Click image to zoom
Check BRICS Countries Solution
Question 2 Lists Frequency

Count Frequency of Each Element in a List

Write a Python program to traverse a list containing duplicate items and display the frequency (occurrence count) of every distinct element.

Solution Code Screenshot Click image to zoom
Count Frequency in List Solution
Question 3 Lists Comparison Count

Count Elements Greater Than a Given User Number

Write a Python program to take a target number from the user and count how many items in a predefined list of numbers are strictly greater than that number.

Solution Code Screenshot Click image to zoom
Count Greater Than User Number Solution
Question 4 Lists Deduplication

Delete All Duplicate Elements from a List

Write a Python program to remove all duplicate elements from a list, preserving only unique values in the order of their first appearance.

Solution Code Screenshot Click image to zoom
Delete All Duplicate Elements Solution
Question 5 Lists Intersection

Find Common Elements in Two Lists

Write a Python program to read or define two separate lists and create a new list containing only the elements common to both.

Solution Code Screenshot Click image to zoom
Common in Two Lists Solution
Question 6 Lists Difference

Find Elements Present in One List but Not in Another

Write a Python program to compare two lists and print elements that are present in the first list but absent from the second list.

Solution Code Screenshot Click image to zoom
Elements Not in Other List Solution
Question 7 Lists Min Max

Find Maximum and Minimum Numbers in a List

Write a Python program to find and display the maximum and minimum numbers from a given list of numerical values.

Solution Code Screenshot Click image to zoom
Find Max Min Solution
Question 8 Lists Prime Filter

Find All Prime Numbers in a User-Provided List

Write a Python program to accept a list of integers from the user, test each number for primality, and extract all prime numbers into a separate list.

Solution Code Screenshot Click image to zoom
Prime Number from User List Solution
Question 9 Lists Successor & Predecessor

Find Predecessor and Successor for List Elements

Write a Python program to search for a specified element in a list and display its immediate predecessor (previous item) and successor (next item).

Solution Code Screenshot Click image to zoom
Successor and Predecessor Solution
Question 10 Lists Fibonacci

Generate and Store First 10 Fibonacci Numbers in a List

Write a Python program to compute the first 10 terms of the Fibonacci sequence and store them into a list, printing the resulting sequence.

Solution Code Screenshot Click image to zoom
First 10 Fibonacci Solution
Question 11 Lists Math & Squares

Generate Squares of Numbers Between 1 and 20

Write a Python program to generate a list containing squares of all integers from 1 up to 20 using a loop or list comprehension.

Solution Code Screenshot Click image to zoom
Squares Between 1 and 20 Solution
Question 12 Lists Element-wise Sum

Create a 3rd List Containing Element-wise Sum of Two Lists

Write a Python program taking two equal-length numerical lists, adding corresponding elements at each index position, and storing the resulting sums in a third list.

Solution Code Screenshot Click image to zoom
Sum of 1 and 2 List Solution
Question 13 Lists Basic Methods

Python Lists Core Operations and Practice

Write a Python script demonstrating foundational list operations: appending, inserting, popping, slicing, and index referencing on heterogeneous elements.

Solution Code Screenshot Click image to zoom
List Practice Solution
Question 14 Lists Even Numbers

Print All Even Numbers from User-Input List

Write a Python program to populate a list of integers from user input, iterate through the list, and display only the even numbers.

Solution Code Screenshot Click image to zoom
Even Numbers User Input Solution
Question 15 Lists Sorting

Sort and Print List in Ascending Order

Write a Python program to read numerical list items from the user and arrange them in ascending order using list sorting methods or a sorting algorithm.

Solution Code Screenshot Click image to zoom
Print in Ascending Order Solution
Question 16 Lists Word Sort

Sort and Print Words in Alphabetical Order

Write a Python program to accept a series of string words into a list and print them sorted in alphabetical (lexicographical) order.

Solution Code Screenshot Click image to zoom
Word in Alphabetical Order Solution
Question 17 Lists Transformation

Replace All Negative Numbers in a List

Write a Python program to traverse a numerical list and replace every negative number with zero (or its positive absolute equivalent), updating the original list.

Solution Code Screenshot Click image to zoom
Replace Negative Numbers Solution
Question 18 Lists Partitioning

Separate Positive and Negative Numbers into Two Lists

Write a Python program to take a mixed list of positive and negative integers and partition them into two separate lists: one for positive values and another for negative values.

Solution Code Screenshot Click image to zoom
Separate Positive and Negative Solution
Question 19 Lists Rotation

Right Rotate List: Shift Elements and Last to First

Write a Python program to circularly shift all elements of a list one position to the right, moving the last element to the first index position.

Solution Code Screenshot Click image to zoom
Shift Elements Last to First Solution
Question 20 Lists Sum Even Odd

Sum Even and Odd Elements Separately in a List

Write a Python program to calculate and display the total sum of all even numbers and the total sum of all odd numbers in a list separately.

Solution Code Screenshot Click image to zoom
Sum Even Odd Separately Solution
Question 21 Lists Unique Filter

Build a Unique Elements List from User Input

Write a Python program that accepts a series of inputs from the user and constructs a new list containing only unique items, ignoring duplicates as they are entered.

Solution Code Screenshot Click image to zoom
Unique List from User Input Solution
Question copied to clipboard!