O'Reilly logo

Python Recipes Handbook: A Problem-Solution Approach by Joey Bernard

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

© Joey Bernard 2016

Joey Bernard, Python Recipes Handbook, 10.1007/978-1-4842-0241-8_1

1. Strings and Texts

Joey Bernard

(1)Fredericton, New Brunswick, Canada

Since the earliest days of computing, data used in computations was stored in basic text files. Anyone who has written shell scripts knows all too well that Unix systems and their utilities are built around the assumption that processing text will be much of the work of the program. Python is no different; it provides several programming elements to help with basic text processing tasks.

To begin, let’s note how Python stores strings. Strings are immutable lists, so they cannot be changed. Any change to a string’s contents requires making copies to new locations in memory. You must always keep ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required