The document outlines a series of programming exercises focused on list manipulation in Python. Tasks include generating multiples of a number, calculating factorials, finding non-repeating elements, identifying intersections of lists, moving zeros to the end, determining the most frequent element, and checking for palindromes. Each exercise provides an example input and expected output to guide implementation.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
8 views
List Exercises(Part 2)
The document outlines a series of programming exercises focused on list manipulation in Python. Tasks include generating multiples of a number, calculating factorials, finding non-repeating elements, identifying intersections of lists, moving zeros to the end, determining the most frequent element, and checking for palindromes. Each exercise provides an example input and expected output to guide implementation.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1
List Exercises (Part 2)
1. Write a program that generates a list of multiples of a given number up to a specified
value. Example: Input: number = 3, max_value = 15 Output: [3, 6, 9, 12, 15] 2. Given a list of integers, return a new list containing the factorial of each number. Example: Input: [1, 2, 3, 4] Output: [1, 2, 6, 24] 3. Find Non-Repeating Element. Given a list of integers, find the first non-repeating element. If all elements repeat, return None. Example: Input: [4, 5, 4, 6, 7, 7, 6] Output: 5 4. Find the Intersection of Two Lists. Given two lists, return a list containing the common elements (without duplicates). Example: Input: [1, 2, 3, 4], [3, 4, 5, 6] Output: [3, 4] 5. Move All Zeros to the End. Given a list of integers, move all the zeros to the end of the list while maintaining the relative order of the non-zero elements. Example: Input: [0, 1, 0, 3, 12] Output: [1, 3, 12, 0, 0] 6. Find the element that appears most frequently in a list without using dictionaries or built-in functions. Example: Input: [1, 2, 2, 3, 3, 3, 4] Output: 3 7. Write a program to check if a list reads the same backward as forward (palindrome) without using slicing or reverse methods. Example: Input: [1, 2, 3, 2, 1] Output: True