from non-english-speaking sources may use very different lettersand may be encoded very differently when stored in files as we saw in python addresses this by distinguishing between text and binary datawith distinct string object types and file interfaces for each this support varies per python linein python there are three string typesstr is used for unicode text (including ascii)bytes is used for binary data (including encoded text)and bytearray is mutable variant of bytes files work in two modestextwhich represents content as str and implements unicode encodingsand binarywhich deals in raw bytes and does no data translation in python xunicode strings represent unicode textstr strings handle both bit text and binary dataand bytearray is available in and later as back-port from normal filescontent is simply bytes represented as strbut codecs module opens unicode text fileshandles encodingsand represents content as unicode objects despite such version differencesif and when you do need to care about unicode you'll find that it is relatively minor extension--once text is in memoryit' python string of characters that supports all the basics we'll study in this in factthe primary distinction of unicode often lies in the translation ( encodingstep required to move it to and from files beyond thatit' largely just string processing againthoughbecause most programmers don' need to come to grips with unicode details up fronti've moved most of them to when you're ready to learn about these more advanced string conceptsi encourage you to see both their preview in and the full unicode and bytes disclosure in after reading the string fundamentals material here for this we'll focus on the basic string type and its operations as you'll findthe techniques we'll study here also apply directly to the more advanced string types in python' toolset string basics from functional perspectivestrings can be used to represent just about anything that can be encoded as text or bytes in the text departmentthis includes symbols and words ( your name)contents of text files loaded into memoryinternet addressespython source codeand so on strings can also be used to hold the raw bytes used for media files and network transfersand both the encoded and decoded forms of nonascii unicode text used in internationalized programs you may have used strings in other languagestoo python' strings serve the same role as character arrays in languages such as cbut they are somewhat higher-level tool string fundamentals