You are on page 1of 2

1.

Lists
Exercises for Observation:

1. Write a program to read a list of N numbers and find the sum, sum of even numbers, a sum of odd
numbers, biggest and smallest number in the given list?

2. Write a function that takes in two sorted lists and merges them. The lists may not be of the same
length and one or both may be empty. [Note: Don’t use any Python built-in methods or functions]

3. Write a program to read a list of elements from user and returns a new list with only the unique
elements from the original.

4. Define a function, which takes a list variable as a parameter and find mode (most repeated value) in
the given list?

5. Create a list which contains a list of sid and sname([[sid,sname]]). Display the following menu and
perform the operations until the user wants to be quit from the program.

        MENU

    1. Add student details(append)

    2. Add student details(insert)

    3. Display list

    4. Display student name for given sid

    5. Display student id for given sname

    6. Delete student details

    7. Exit
Exercises for Record:

1. Write a function called remove_duplicates and pass one list as a parameter and returns a new list
with only the unique elements from the original.

2. Create a list which contains a list of sid and sname([[sid,sname]]). Display the following menu and
perform the operations until the user wants to be quit from the program.

        MENU

    1. Add student details(append)

    2. Add student details(insert)

    3. Display list

    4. Display student name for given sid

    5. Display student id for given sname

    6. Delete student details

    7. Exit

You might also like