redis.rpush("mylist", "one", "two", "three", "two", "one")

assert redis.lrem("mylist", 2, "two") == 2

assert redis.lrange("mylist", 0, -1) == ["one", "three", "one"]

Arguments

key
str
required
The key of the list.
count
number
required
How many occurrences of the element to remove.
element
Any
required
The element to remove

Response

The number of elements removed.
redis.rpush("mylist", "one", "two", "three", "two", "one")

assert redis.lrem("mylist", 2, "two") == 2

assert redis.lrange("mylist", 0, -1) == ["one", "three", "one"]