December 2013
Intermediate to advanced
152 pages
2h 8m
English
CHAPTER 4
![]()
Strings
String objects exist in practically every programming language. A string is simply a series of characters assigned to a variable. Python strings are immutable, which means that once created, they can not be changed. String assignments look like this:
s = 'Abcdefg'
Appending to Srings
Although Python strings are immutable, we can perform many operations on them, including appending other information to the string.>>> a = "This is a test"
>>> a = a + " of strings">>> a'This is a test of strings'
In this case, a copy of the string is made, the second string is appended to the copy, then the original is deleted and the new string ...
Read now
Unlock full access