Data Structures and Algorithms

   

Python String Slicing

Authors: K. S. Ooi

Python slice syntax is nothing new. We find such syntax in other programming languages. However, string slicing in Python is usually covered briefly in standard references, Python textbooks as well as favorite websites. In this article, the author attempts to explore every nook and cranny of string slicing in Python. Besides proving a string slicing theorem, the author explores the limitation of string slicing expressed in everyday languages, the default values of all three arguments of the slice, the minimal string slice statement, the meaning of negative step, the influence of step on other two arguments, and two suggestions to correctly predict the substring of a slice.

Comments: 8 Pages.

Download: PDF

Submission history

[v1] 2020-12-24 20:20:17

Unique-IP document downloads: 1262 times

Vixra.org is a pre-print repository rather than a journal. Articles hosted may not yet have been verified by peer-review and should be treated as preliminary. In particular, anything that appears to include financial or legal advice or proposed medical treatments should be treated with due caution. Vixra.org will not be responsible for any consequences of actions that result from any form of use of any documents on this website.

Add your own feedback and questions here:
You are equally welcome to be positive or negative about any paper but please be polite. If you are being critical you must mention at least one specific error, otherwise your comment will be deleted as unhelpful.

comments powered by Disqus