keyboard the character \and one or more characters following it in the string literalare replaced with single character in the resulting string objectwhich has the binary value specified by the escape sequence for examplehere is five-character string that embeds newline and tabs ' \nb\tcthe two characters \ stand for single character--the binary value of the newline character in your character set (in asciicharacter code similarlythe sequence \ is replaced with the tab character the way this string looks when printed depends on how you print it the interactive echo shows the special characters as escapesbut print interprets them insteads ' \nb\tcprint(sa to be completely sure how many actual characters are in this stringuse the built-in len function--it returns the actual number of characters in stringregardless of how it is coded or displayedlen( this string is five characters longit contains an ascii aa newline characteran ascii band so on if you're accustomed to all-ascii textit' tempting to think of this result as meaning bytes toobut you probably shouldn' really"byteshas no meaning in the unicode world for one thingthe string object is probably larger in memory in python more criticallystring content and length both reflect code points (identifying numbersin unicode-speakwhere single character does not necessarily map directly to single byteeither when encoded in files or when stored in memory this mapping might hold true for simple -bit ascii textbut even this depends on both the external encoding type and the internal storage scheme used under utf- for exampleascii characters are multiple bytes in filesand they may be or bytes in memory depending on how python allocates their space for othernon-ascii textwhose charactersvalues might be too large to fit in an -bit bytethe character-to-byte mapping doesn' apply at all in fact defines str strings formally as sequences of unicode code pointsnot bytesto make this clear there' more on how strings are stored internally in if you care to know for nowto be safestthink characters instead of bytes in strings trust me on thisas an exc programmeri had to break the habit too string fundamentals