Encoding an decoding

Please may I know the purpose behind encoding and decoding? I don’t get the reason behind the whole concept. I mean I don’t know why we do it or most importantly when we do it.

A computer doesn’t really store text characters, but instead stores a number, and then translates that number into a character on your screen. In the past the most popular was ASCII which really only worked for Americans and maybe a few European languages. Later a system called Unicode was invented which attempts to take every character in human languages around the world and assign them a number. What you’re doing is loading a series of numbers from a unicode input, and then telling python to convert them to characters that you can see. Without this conversion you’d just have a string of integers that mean nothing.

Thank you. But may I ask, for example, what project will require this?

If all you ever do is process text written by you and people who speak your language, then you probably won’t run into it much. BUT, in the python world they love making you these two functions even when they could have figured it out for you.

But, a very good example is any text writing or reading application. Browsers, text editors, web applications, etc.

A free service run by Zed A. Shaw for learncodethehardway.org.