in [ ] [ 'ftypeerror traceback (most recent call lastin (---- [ 'ftypeerror'strobject does not support item assignment in [ ] replace('string''longer string'in [ ] out[ ]'this is longer stringmany python objects can be converted to string using the str functionin [ ] in [ ] str(ain [ ] out[ ]' strings are sequence of characters and therefore can be treated like other sequencessuch as lists and tuplesin [ ] 'pythonin [ ]list(sout[ ][' '' '' '' '' '' 'in [ ] [: out[ ]'pytthe backslash character is an escape charactermeaning that it is used to specify special characters like newline \ or unicode characters to write string literal with backslashesyou need to escape themin [ ] ' \\ in [ ]print \ if you have string with lot of backslashes and no special charactersyou might find this bit annoying fortunately you can preface the leading quote of the string with which means that the characters should be interpreted as isin [ ] 'this\has\no\special\charactersin [ ] out[ ]'this\\has\\no\\special\\charactersadding two strings together concatenates them and produces new stringin [ ] 'this is the first half in [ ] 'and this is the second halfin [ ] out[ ]'this is the first half and this is the second halfthe basics www it-ebooks info