00:01
We want to write a function called original sum that accepts a string argument and returns the sum of the ordinal values of each character in the string.
00:15
The ordinal value of a character is its numeric unicode code point in decimal.
00:22
So first, i'm going to explain a little bit that last part that is what is the ordinal of a character is.
00:31
And for that, i'm using the ascii table here.
00:34
Let's put the number.
00:36
We go ascii table.
00:42
And that ascy stands for american standard code for information interchange that was developed in 1960.
00:52
And that's a way of, that was a way of representing characters through numbers.
00:59
There is inside the computer we can only handle numbers.
01:04
And so to print characters or to use another set of non -printable characters, we had to use some coding, numerical coding.
01:15
And that's the asky table.
01:17
This is the first part of the asky table that is from 0 to 127, that is 128 characters.
01:26
There are some special characters.
01:29
The first column, for example, corresponds to special characters.
01:33
They are not printable characters and from the space which is code 32 here we have the printable characters and we can see we have the numbers as characters here this part of the table we have the uppercase letters this part of the table and the lowercase letters right here and there are all the symbols and the there is another part of the table that completes these first 128 characters, and that was even further developed to construct what we call today the unico table, which can represent practically or almost any character that can be used, different languages and all that.
02:36
So the idea is to represent inside a computer, characters that can be special, printable, etc.
02:46
Using numerical codes.
02:50
And for example, in this case, we talk about which is the ordinal code of the letter a in lowercase.
03:01
We see that is here.
03:04
And then the ordinal of this character is 97.
03:10
For example, the arroba character, which is right here, has a code, a unicode of 64.
03:23
So it's ordinal is 64.
03:27
The blank space, suppose i'm printing this to say this is a blank space.
03:34
We can see it right here space and the code is 32 space.
03:48
And so on.
03:52
You have different, you can see the table and look at the code...