Assign5 (T&T)
Assign5 (T&T)
4. Write a program to print all the element in a list that are greater than a given value.
5. Write a program to print all the common elements of 2 list.
10. Write a program to split the even and odd elements into 2 different lists.
11. Write a Python program to create a tuple
12. Write a Python program to create a tuple with different data types.
13. Write a Python program to unpack a tuple in several variables.
16. Write a Python program to get the 4th element and 4th element from last of a tuple.
17. Write a Python program to find the repeated items of a tuple.
18. Write a Python program to check whether an element exists within a tuple.
19. Write a Python program to slice a tuple.
Sample list: [(10, 20, 40), (40, 50, 60), (70, 80, 90)]
Expected Output: [(10, 20, 100), (40, 50, 100), (70, 80, 100)]
Sample data: [(), (), ('',), ('a', 'b'), ('a', 'b', 'c'), ('d')]
30. Write a Python program to count the elements in a list until an element is a tuple.