4 ms·
> l.extend(12) ...For a list "l": that is wrong, "extend" expects an iterable, not an int.
by asmosoinio 10y ago
> l.extend(12)
...For a list "l": that is wrong, "extend" expects an iterable, not an int.
- jwilk 10y agoIt's l2 (another list), not 12.
- jachee 10y agoA clear case where the "Readability counts." principle from "The Zen of Python" applies.
- asmosoinio 10y agoAh, true, my bad. Double confusing since the comment text, especially with the font, hints more at the "add twelve" case: > "Add l2 items to list" If it was worded for example "Add items of l2 to l", I think I would not have misinterpreted it. https://www.slideshare.net/MattHarrison4/learn-90/61?src=clipshare https://www.slideshare.net/MattHarrison4/learn-90/61?src=cli...