How do I remove all the elements which are equal to a given element in a python list?

Viewed 29

Here I want to remove all 19's in a given list ga:

ga = [20,20,19,19,21]

Gi = list(ga)

n = Len(ga)

z = min(ga)

for x in range(n):
    if x == z:
        Gi. Remove(x)

print(Gi)
0 Answers
Related