Douglas Jewsbury's Articles
When not programming in Python, Doug fills in the time by writing articles, editing books, teaching English as a foreign language and doing translations. He relaxes by making things out of rope, including "monkey's fist" keyrings that are used in the Tower of London.
Python strings as sequences of characters Python strings are sequences of individual characters, and share their basic methods of access with those other Python sequences – lists and tuples. The simplest way of extracting single characters from strings (and individual members from any sequence) is to unpack them into corresponding variables.
>>> s = 'Don'
>>> a, b, c = s # Unpack into variables
Unfortunately, it’s not […]Read More