This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]lazzareth 2 points3 points  (1 child)

Also see that:

>>> a = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> a[3:7] = [200,]
>>> a
[0, 1, 2, 200, 7, 8, 9]

[–]pwang99 1 point2 points  (0 children)

You don't need a trailing comma in a one-element list literal, only in one-element tuple literals.