Understanding slice notation


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
42 views

I need a good explanation (references are a plus) on Python's slice notation.

To me, this notation needs a bit of picking up.

It looks extremely powerful, but I haven't quite got my head around it.

by (550 points) | 42 views

1 Answer

0 like 0 dislike

A Go slice is implemented as a struct:

type slice struct {
    array unsafe.Pointer
    len   int
    cap   int
}
by (1.2k points)

Related questions

0 like 0 dislike
2 answers
0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
28,105 users