Python For Beginners in 3 Minutes | String Manipulation With Python ord() and chr() functions

preview_player
Показать описание
In this video we will manipulate strings using 2 Python functions namely "ord" and "chr". We will also learn what is Unicode and how it relates to strings.

In this multi-part video series on string, we will manipulate a string that contains a secret message and convert it to an obscure and cryptic set of characters to hide the original text.

But Before we do some spy stuff, we need to know and understand first a thing or two about strings which I have not covered in the preceding videos.

Strings are composed of characters found in an industry-standard encoding system called "Unicode". In Unicode, each character, like 'A', is represented by a number 65. This number is uniform across different operating systems like Windows, Linux, or iOS of Apple.

If we search in Google "how many characters in unicode", you will get the answer of 143, 859 characters. Of these characters are the letters of the English alphabet including the "space" and special characters like asterisk (*) and hashtag (#).

Since each letter in the alphabet is represented by a number in Unicode, we are able to manipulate the letter through its numerical value. Which means, if A is 65, we can turn it into B by adding 1 to its numerical value.

There are two (2) functions in Python that will help us with this task. One function is called "ord" which converts any Unicode character into its numerical value. The other function reverses this effect. The "chr" function takes a Unicode number and converts it into a Unicode character.

I hope you will learn from this video. If you have any suggestions, questions, or clarifications, please leave your comments below.

And don't forget to subscribe to get updated with the next videos in this series.

Music Credit: See You On The Otherside - The 126ers

#python​ #unicod #string #computerprogramming #unicode
Рекомендации по теме
Комментарии
Автор

Full watched well said thanks for sharing sir.

Javellanas