Logo

Programming-Idioms

History of Idiom 135 > diff from v9 to v10

Edit summary for version 10 by Oldboy:
New Python implementation by user [Oldboy]

Version 9

2017-09-21, 18:57:13

Version 10

2017-10-28, 12:32:55

Idiom #135 Remove item from list, by its value

Remove at most 1 item from list items, having value x.
This will alter the original list or return a new list, depending on which is more idiomatic. If there are several occurrences of x in items, remove only one of them.

Idiom #135 Remove item from list, by its value

Remove at most 1 item from list items, having value x.
This will alter the original list or return a new list, depending on which is more idiomatic. If there are several occurrences of x in items, remove only one of them.

Code
items.remove(x)