appendix python review collections python provides several data types that can be used to store and manage data collectionsthe stringtuplelist and dictionary strings python also provides several built-in collection classes strings are very common and fundamental in most programming languages in pythonstrings are immutable objects of the built-in str classwhich store the sequence of characters comprising the string number of basic operations can be performed on stringssome of which are described in this section two strings can be concatenated using the plus operator for examplestrvar 'this is fullstr strvar " stringresults in the string "this is stringbeing assigned to variable fullstr to concatenate string with non-string valueyou must first create string representation of the non-string using the str(constructorresult "the value of is strx python provides the built-in len(function that can be applied to any of the built-in collections when used with stringit returns the number of characters contained in the string print"length of the string "len(namein an earlier sectionwe saw that the individual characters of string can be accessed by traversing the sequence using an iterator an individual character of string can also be accessed by specifying an integer subscript or index representing its position within the string consider the following examplewhich prints the first and last character of stringmsg "this is string!print"the first character is"msg[ print"the last character is"msg[- both positive and negative subscripts can be used positive subscript represents the offset of the character from the front of the string while negative subscript indicates the offset from the end of the stringas illustrated herename - - - - - - - - - - the subscript must be within the valid range for the given stringotherwisean exception will be raisedresulting in an error printing dashed line is common operation in text-based applications one way to do it is as string literal