By using list comprehension, write a program to print the list after removing the value 24 in [12,24,35,24,88,120,155].


Topic: By using list comprehension, write a program to print the list after removing the value 24 in [12,24,35,24,88,120,155].

Solution

li = [12, 24, 35, 24, 88, 120, 155]
li = [x for x in li if x != 24]
print(li)



List all Python Programs