So now let us understand or the way we have created this file, and if you want to use this, you can
basically use this currently in an interactive shell to check whether a particular string is in English
or not.
So, for example, if we go back here and we see here the import over now, the fine name that we have
created is checking, shall we say, import Czech English.
And then we use here the matter from Czech English dot.
Again, the method name is all we are having is English, Czech.
OK, so we will use this.
Say is.
English check and we give your say, is this sentence in English clothes, this OK, and check this
out.
But what you find we are having this majesty SDR is not defined.
So let us check this.
This is much estie or.
OK, let's save it.
And again, let us.
Right down the same thing that's on line number twenty five, let's go to line.
Twenty five,
so in this, if we just check the output in the if condition.
OK, now, once you have saved us, we will have to run the module again and again, we will have to
execute it from import statement.
So we will have to say in both English and English, not C is English.
Chick does.
The matter is English.
And here we are passing is this sentence in
English that you will get the value to.
Now this is one way in which we can test this, OK?
Now if you basically let us understand the particular program that we have created now for staying over
here that we have is creating the constants in our file.
So we have created in this case, the variables as constants, which are basically an uppercase.
OK, so we have already understood that constants are nothing but variables whose values should never
be changed after the set.
So here the operator, SDR is a constant containing twenty six uppercase letters that we have set up
for convenience and will save time typing.
So we have used the operator SDR Constant to set up the letters and space SGA, which contains all the
uppercase lowercase as well as a space character or type character and a new line character.
So instead of typing out all of the uppercase lowercase letters, we just concatenated Neapolitans zero
with the lowercase letters written by a couple letters.
Jadot lower function and additional nonlocal characters or type a new line are represented over here
in the case of Slashdot.
OK, moving to the dictionary now before we continue with the rest of the code we have written here,
we will understand more about the dictionary ticker-Tape to understand how to convert a text file into
a story so the dictionary dictates torse values which can contain multiple other values.
Just as the do enlist, we use an integer index to retrieve item in the list, like, for example,
the last one in the index 42.
But for each item in the dictionary value instead use a key to retrieve a value.
Now, although we can use only individuals to retrieve items from a list, looky in a dictionary, value
can be an integer or a string like for example, see where in the square brackets, say, bitin or where
in the square brackets, an index.
Now, dictionaries, let us organize our program, retain more flexibility than list and don't store
items in any particular order instead of using square brackets, as the Lizardo Dictionary uses this
Colibri that we have created over here.
If you see so here, this English word is still we have created as a type like dictionary.
So our dictionaries items are typed as key value pair in which key and the values are separated by colons.
Multiple key value players are separated by commas not to retrieve values from dictionary.
We can use square brackets with the key between them.
Similarly, to do indexing, what list will give it a try for retrieving values from a dictionary using
GIS?
We will go back to our interactive shell and give it a try.
Here we would create a dictionary one is equal to.
Let's give your psyche one colon.
See, this is value for given.
OK, then we have a comma.
Next we have ciggie two and here we have some value for you to reclose this dictionary.
OK, and now we say dictionary one we want to print the value of given.
So we get their case, captain, so we'll see dictionary one in bracket Kiwa, we get get this is the
value for Kuvan.
Similarly, if we say dictionary one and we try to bring the value of data, we get the value for it.
OK, so your first thing is we have set up a dictionary.
Kolas dissy do one with doki value, but we then assign the value associated with one string, which
is another string as with list, and we can store all kinds of data types in our dictionaries notat
as with list variables don't store dictionary values.
Instead, the store the references to dictionaries.
So we will look at an example which will show us two variables with references to the same dictionary,
for example, of one which we have created now.
OK, let's say we create the two, which is equal to see Biton and the value for this, say, 50.
OK, then we create over one which is equal to the two.
OK, now we say, well, one at the index of Biton, we want to change it to 90.
OK, now if we say it does a dictionary, do we get by is equal to 90 or if we say well one again we
get Biton is equal to 90.
Right.
So the first line of all your sets up another dictionary, which is a dictionary to understand we have
only one key value pair in that.
OK, so now you can see that it stores an image of Al-Yousef, 50, associated with the kids Biton The
second line assigns the dictionary evaluable to another variable, which is where one and you can then
use this variable to change the original dictionary value associated with Python stringy to 90, the
new variable that is dictionary two and where one should return the same dictionary key value pair with
the updated value.