Python List Assignment
Python List Assignment
Date ………/2022
13. WAP in Python to accept any ten numbers from the user in a list and display the maximum
and minimum number along with its position.
14. WAP to split the list into two separate lists, all even numbers in one list and odd in another.
15. Assuming that num is a list of integers, write code display the list. The code should then
replace each element having even value with its half and each element having odd value with its
double, and then display the changed list. Eg: if list has: 3, 4, 5, 16, 9, then the modified list should
have: 6, 2, 10, 8, 18
16. Write a menu driven program which creates an empty list and gives the following options to
the user to perform various operations on a list:
i Append an element to the list
ii Input an element from the user and remove it from the
list iii Remove all elements from the list
iv Count the number of occurrences of an element in the
list v Sort the list
vi Reverse the list
vii Display the list
The program should terminate when the user chooses the option to exit.
17. Write a menu driven program which creates an empty list and gives the following options to
the user to perform various operations on a list:
i Input an element and a location from the user and insert the element at the entered location in
the list.
ii Input a location from the user and remove the element from that location in the
list. iii Input an element from the user and find its location in the list.
iv Display the list in sorted order without sorting the list.
v Display the list in reverse order without reversing the
list. vi Display the list
The program should terminate when the user chooses the option to exit.