4 ms·
first, _, last = [1, 2, 3, 4, 5] I guess this is a typo, it should be first, *_, last = [1, 2, 3, 4, 5] (As explained above!) Other than that, nice list
by TrianguloY 3y ago
first, _, last = [1, 2, 3, 4, 5]
I guess this is a typo, it should be
first, *_, last = [1, 2, 3, 4, 5]
(As explained above!)
Other than that, nice list of python tricks, I love not-so-known features because it can make code shorter and prettier!
- erikvdven 3y agoSharp! Updated that line. And thank you for the compliment :)