You are on page 1of 2

LIST ASSIGNMENT-

ASSIGNMENT-1
______________________________________________________________________________
Q1. Write a program in python, to create a list. Display all elements present in a list . Using
loop.

Q2. Write a program in python, to create a number list. Calculate and display sum of each
elements present in a list.

Q3. Write a program in python, to create a list. Display all elements present in a list in reverse
order . Using loop.

For example: list elements are : 1 2 3 4 5

Output is : 5 4 3 2 1

Q4. Write a program in python, to create a number list. Search and display largest number
present in a list . Without using max( ).

Q5. Write a program in python, to create a number list. Search and display smallest number
present in a list . Without using min( ).

Q6. Write a program in python, to create a number list. Calculate and display sum of each
even elements present in a list.

Q7. Write a program in python, to create a number list. Calculate and display sum of those
elements whose last digit is 5.

Q8. Write a program in python, to create a number list. Calculate and display sum of those
elements which are devisal by 3 and 7.

Q9. Write a program in python, to create a number list. Arrange and display all elements in
reverse order.

Q10. Write a program in python, to create two number lists a and b . Swap and display all
elements of both lists.

Q11. Write a program in python, to create a number list. Replace and display first half elements
with second half elements of a list.

For example: list elements are : 1 2 3 4 5

Output is : 4 5 3 1 2

Q12. Write a program in python, to create a number list. Arrange and display all elements in
following way .

For example: list elements are : 1 2 3 4 5

Output is : 2 1 4 3 5
LIST ASSIGNMENT-
ASSIGNMENT-2
______________________________________________________________________________
Q1. Write a UDF in python, it will take two arguments list(sequence of elements) and its size .
Function arrange and display all elements in reverse order.

Q2. Write a UDF in python, it will take three arguments list a, list b and its size. Function
swap and display all elements of both lists.

Q3. Write a UDF in python, it will take two arguments list(sequence of elements) and its size .
Replace and display first half elements with second half elements of a list.

For example: list elements are : 1 2 3 4 5

Output is : 4 5 3 1 2

Q4. Write a UDF in python, it will take two arguments list(sequence of elements) and its size .
Replace and display all elements in following way .

For example: list elements are : 1 2 3 4 5

Output is : 2 1 4 3 5

Q5. Write a UDF in python, it will take three arguments list(sequence of elements) , its size
and finding element . Function search and display element is present in the given list or
not . Using linear search.
OR
Write a UDF in python, it will take three arguments list(sequence of elements) , its size
and finding element . Function search and return 1 if element is present in the given list
otherwise return -1 . Using linear search.
Q6. Write a UDF in python, it will take three arguments list(sequence of elements) , its size
and finding element . Function search and display element is present in the given list or
not . Using Binary search.
OR
Write a UDF in python, it will take three arguments list(sequence of elements) , its size
and finding element . Function search and return 1 if element is present in the given list
otherwise return -1 . Using Binary search.

Q7. Write a UDF in python, it will take two arguments list(sequence of elements) and its size.
Function arrange and display elements in ascending order . Using selection sort.

Q8. Write a UDF in python, it will take two arguments list(sequence of elements) and its size.
Function arrange and display elements in descending order . Using bubble sort.

Q9. Write a UDF in python, it will take two arguments list(sequence of elements) and its size.
Function arrange and display elements in ascending order . Using insertion sort.

Q10. Write a UDF in python, it will take two arguments list(sequence of elements) and its size.
Function count and display no of prime elements present in a given list.

You might also like