[go: up one dir, main page]

0% found this document useful (0 votes)
22 views2 pages

Worksheet 5 - List Manipulation

This document provides 25 examples of list manipulation problems to solve without using built-in functions in Python. Some examples include writing a program to find the minimum/maximum element and index in a list, calculating the mean and reversing elements of a list, searching for an element, counting frequencies, and merging or modifying lists in various ways such as adding values, swapping elements, or shifting positions. The problems cover basic list operations and algorithms.

Uploaded by

collect3.141
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views2 pages

Worksheet 5 - List Manipulation

This document provides 25 examples of list manipulation problems to solve without using built-in functions in Python. Some examples include writing a program to find the minimum/maximum element and index in a list, calculating the mean and reversing elements of a list, searching for an element, counting frequencies, and merging or modifying lists in various ways such as adding values, swapping elements, or shifting positions. The problems cover basic list operations and algorithms.

Uploaded by

collect3.141
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

LIST MANIPULATION

GRADE 11
(without using built in functions)
1. WAPS to find minimum element from a list of element along with index.
2. WAPS to find mean of a given list.
3. WAPS to search for an element in the list.
4. WAPS to count the frequency of given element in list of numbers.
5. WAPS to reverse an array of integers.
6. WAP to enter n values from the user. If the entered values are multiples of
9, then add them to the list.
7. WAP that adds 5 to all odd values and 10 to all even values in the list.
8. WAP to find the sum of all values which are ending with 3 from the list.
9. WAP to enter +ve and –ve nos from the user to a list. Create 2 lists to store
these numbers separately.

10.WAP to enter 2 lists. Create a new list which will have 1st element of the
1st list, then 1st element of the 2nd list and so on till the end.
11.WAP that takes two lists of same size and add their values together to
form a new list, whose elements are sums of the corresponding elements
of list1 and list 2.
12. WAP to accept a list and display:
a. Alternate elements
b. Sum and average of all the elements
c. Even elements and odd elements
13.WAP to find the maximum and minimum element in the list.
14.WAP to Search for a particular element and give its first occurrence.
15.WAP to count number of times an element occurs in List.
16.WAP to find frequencies of all elements of a list. Also, print the list of
unique elements in the list and duplicate elements in the given list.
17.WAP to reverse a list.
18.WAP to exchange the values of the first half of the array with the second
half of the array.
a. For example, if the array contains:
i. 2, 4, 1, 6, 7, 9, 23, 10
b. The resultant array is:
i. 7, 9, 23, 10, 2, 4, 1, 6

19.WAP to count the number of elements within a given range.


20.WAP to transfer contents of a list to two different lists ODD and EVEN. The
odd list should contain elements from odd positions and even list should
have elements from even positions.
21.WAP to modify the contents of the list in such a way that the elements
that are multiples of 10 are swapped with the value present next to it.
22.WAP to create a list and replace elements having odd values with thrice
their values and elements having even values with twice their values.
23.WAP to shift elements of a list so that first element moves to second
element and so on. Last element needs to be placed at first location.
24.Write a Python program to find the list of words that are longer than n
from a given list of words.
25.WAP to accept 2 lists in ascending. Merge these lists into a third one in
ascending order.

***

You might also like