May 2018
Beginner
472 pages
15h 3m
English
This chapter covers
Handling text—from user input to filenames to chunks of text to be processed—is a common chore in programming. Python comes with powerful tools to handle and format text. This chapter discusses the standard string and string-related operations in Python.
For the purposes of extracting characters and substrings, strings can be considered to be sequences of characters, which means that you can use index or slice notation:
>>> x = "Hello" >>> x[0] 'H' >>> x[-1] ...
Read now
Unlock full access