write a python program to remove an element 3 from the following tuple T=(1,2,3,4,5)
Answers
Answered by
0
Using list comprehension:
A simple list comprehension can be used to remove a specific element from a tuple list by specifying a condition inside it.
PROGRAM:
my_tuple_list = [(1,2,3,4,5)]
my_tuple_list = [tuple(ele for ele in sub if ele != 3) for sub in my_tuple_list]
print(my_tuple_list)
Similar questions