different values that' more than enough to represent every possible ascii character (in factascii is only bit codebut single byte is nowhere near sufficient for storing all the , possible unicode characters to get around this problemthe unicode standard defines various encoding schemes for packing unicode characters into sequences of bytes the most common encoding is called utf- utf- is variable-length encoding that uses single byte to store characters that are in the ascii subsetbut may need up to bytes in order to represent some of the more esoteric characters that means that string of length characters will end up getting stored in memory as sequence of between and bytesdepending on the actual characters used in the string as rule of thumb for latin alphabets (the usualwesterncharacters)howeverit' pretty safe to estimate that character requires about byte of storage on average programming an encoder let' return to the note-passing example using the python ord and chr functionswe can write some simple programs that automate the process of turning messages into sequences of numbers and back again the algorithm for encoding the message is simple get the message to encode for each character in the messageprint the letter number of the character getting the message from the user is easyan input will take care of that for us message input("please enter the message to encode"implementing the loop requires bit more effort we need to do something for each character of the message recall that for loop iterates over sequence of objects since string is kind of sequencewe can just use for loop to run through all the characters of the message for ch in messagefinallywe need to convert each character to number the simplest approach is to use the unicode number (provided by ordfor each character in the message here is the final program for encoding the messagetext numbers py program to convert textual message into sequence of numbersutilizing the underlying unicode encoding def main()print("this program converts textual message into sequence"print("of numbers representing the unicode encoding of the message \ "get the message to encode message input("please enter the message to encode"