You are on page 1of 1

Python Lab Assignment – 6 (11/10/2022)

1. Write a Program to read the elements into the list and print the sum of odd numbers in it.
For example, if the input list is {10, 15, 20, 23, 40} the output should be 38.

2. Write a Program to read the elements into the tuple and print the sum of even numbers in
it. For example, if the input tuple is {10, 15, 20, 23,40} the output should be 70.

3. Write a Program to read the elements into the tuple and print the even numbers in it.
For example, if the input tuple is {10,15,20,23,40} the output should be 10,20,40;.

4. Write a Program to read the elements into the list and print the odd numbers in it.
For example, if the input list is {10,15,20,23,40} the output should be 15,23.

5. Write a Program to read the elements into the list and print the sum of minimum element
and maximum element in the array.
For example, if the input list is {10,1,2,40,5} then the output is 41.

6. Write a Program to read the elements into the list and print only the even number position
numbers (even indexed) in the list.
For example, if the list is 10,11,23,45,56,78,90}; here the indexing starts from ‘0’ the even
position indexed numbers are 0,2,4,6… The output of this program should print
10,23,56,90.

7. Write a Program to read the elements into the list and print only the odd number position
numbers (odd indexed) in the list.
For example, if the list is {10,11,23,45,56,78,90}; here the indexing starts from ‘0’ the odd
position indexed numbers are 1,3,5,7… The output of this program should print 11,45,78.

8. Write a Program to read the elements into the tuple and print the greatest number in that
array is even number or odd number.
For example, if the tuple is {10,20,45,66,1} the maximum element here is 66. it is an even
number.

9. Write a Program to read the elements into the tuple and print the smallest number in that
tuple is an even number or odd number.
For example, if the tuple is {10,20,45,66,1} the smallest element here is 1. it is an odd
number.

10. Write a program to append a tuple to another tuple.

You might also like