0
Slicing is extremely confusing
I recently learned indexing and to me that was a breeze but slicing confuses me deeply. I thought you could just apply the indexing rules to slicing. Can someone help me understand this better please?
6 Antworten
+ 2
[start:stop:step size]
start is inclusive
stop is exclusive
all are integers.
+ 2
I hope these small tutorials will help you a little bit more:
https://www.w3schools.com/JUMP_LINK__&&__python__&&__JUMP_LINK/python_strings_slicing.asp
https://www.freecodecamp.org/news/slicing-and-indexing-in-python/
the start character is inclusive, the end character is exclusive (in python too, but not in all languages)
0
Tag the relevant programming language
0
Lisa updated
0
I wish the lesson said, for example, [0:3] will only include 0 through 2, but not 3. When explained that way, it makes total sense to me. I had to go to YouTube to understand slicing. Lisa i haven't learned step size, so I have no idea what that is
0
Mihaly Nyilas thank you!