+ 1

Slicing in python

How is slicing of strings performed in python

1st Mar 2025, 12:07 PM
Youmbi Bovan
Youmbi Bovan - avatar
4 Respuestas
+ 3
Youmbi Bovan , slicing is introduced and explained in the tutorial `introduction to python`. the exercises are using slicing with lists and with strings. > if you don't feel comfortable with slicing it is recommended to reread the tutorials. > slicing requires intensive study of this topic (positive indexing, negative indexing, combination with both of them, ...) . you can easily create exercise / test cases by yourself and work with them. > you can use the playground, or if you have a python installation on your device, you can use the interpreter console to do the exercises. the syntax is: > string[start : stop : step] > start (is optional) the index where slicing begins (inclusive). default is 0. > stop (is optional) the index where slicing ends (exclusive). default is the string length. > step (is optional) the interval between characters. default is 1.
2nd Mar 2025, 9:03 AM
Lothar
Lothar - avatar
+ 2
Youmbi Bovan , can you explain exactly what you are interested in? please give some more details?
1st Mar 2025, 3:36 PM
Lothar
Lothar - avatar
0
I wish to know how to slice a string in python
2nd Mar 2025, 6:41 AM
Youmbi Bovan
Youmbi Bovan - avatar