0% found this document useful (0 votes)
19 views1 page

Lists Long Answer Questions

The document contains 12 long answer questions that involve writing programs to perform various operations on lists. The questions involve printing a list, deleting odd/negative numbers, searching a list, removing duplicates, merging sorted lists, linear searching, finding the second largest element, summing elements of nested lists, summing list elements, summing odd list elements, finding the second largest number, and shifting zeros and non-zeros in a list.
Copyright
© © All Rights Reserved
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% found this document useful (0 votes)
19 views1 page

Lists Long Answer Questions

The document contains 12 long answer questions that involve writing programs to perform various operations on lists. The questions involve printing a list, deleting odd/negative numbers, searching a list, removing duplicates, merging sorted lists, linear searching, finding the second largest element, summing elements of nested lists, summing list elements, summing odd list elements, finding the second largest number, and shifting zeros and non-zeros in a list.
Copyright
© © All Rights Reserved
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

Lists

Long Answer Questions

1. Write a program to print all elements of a list CDays. Where CDays is:
Days=[‘Monday’, ‘Tuesday’,
‘Wednesday’,’Thursday’,’Friday’,’Saturday’,’Sunday’]

2. Write a program to delete all the odd numbers and negative numbers in
a numeric list.

3. Write a program to input a list Num with 10 different integer values and
search a particular value and its position in that list

4. Write a program to remove all duplicate elements from a given list.

5. Write a program to merge two sorted lists and return the sorted list as
result

6. Write a program to create a list of N elements and search an element


and its position in the list using the linear search technique.

7. Write a program Second_Largest (Num, N) to find the second largest


element in a list Num.

8. Write a program to enter the data given by the user into two 3X4lists
and find the sum of each element store as another 3X4 list.

9. Given a list of integers, L, write code to add the integers and display the
sum.

10.Given a list of integers, write code to calculate and display the sum of all
the odd numbers in the list.

11.Write a program to find the second largest number of a list of numbers.

12. Write a program that inputs a list of numbers and shifts all the zeros to
right and all non-zero numbers to left of the list.

You might also like