Welcome to the next session in this post, we will be creating the vote, but don't start the right
now for that we are creating a fight.
After executing that fight, we will get the vote back and start my fight created.
And that would be based on the votes in our dictionary file.
That is a dictionary.
They will have to please this fight that we will be creating in the folder where you have a dictionary
dot the OK, so first thing is we would go for a file and say new file and here we would import separate.
Now we are going to define your C get your.
Factum Astraea there to vote as the parameter.
Now here, this will basically return a string of partan form of the given vote, for example, like
if you have zero point one point two point three point four point one point two point three point five
point six.
So it could be something like a Dustbuster or something like that.
OK, so if we see Vore is equal to say, vote of God can look to Apple, then we create here the next
one that is equal to zero.
OK, then we create letters, number one, that is also equal to blank and silver pattern.
One, that it was OK, then we ran a form of saying, see, now we're creating the one in vote that
we have created the object of OK, and we check if our lack of one is not in the letter number one,
then what are you supposed to do?
So here we are saying let's number one at the index of letter one is equal to convert Wistia now ridicule
the value of Nexium.
OK, next number, for example.
So now what are we doing here next month?
And is capital OK?
So after this, what are we trying to do then?
We see the value of the next number one plus is equal to one.
And after that, below the if we see the word
pattern one dot we are spending in that the letter number one in the back of or in the index of left
over after we have completed with this, then the last thing we give you a written statement saying
God, then we join in that the value of more than one.
OK, now once we have completed this, we will define the mean method below.
And in this we are creating say all.
Patterns one is equal to blank, and we create a full one or file object one.
Now we are opening the file that we have on which in which we are supposed to see if this that is dictionary
dot the fight, because this file, we would open it and then we would split this file and get the pattern
of each string and they would list.
So over here, after giving that file reference in the file object, we see the world list.
One object is equal to the file object dot receive, read it and split the file wherever you find a
new line.
So that new line would split one line into your particular fight after you have done that.
Don't forget to close the file object and then Vidana for loop for civil one in your word list one.
OK, and in this or loop we say we get the pattern for each string in this.
So we create here puttanesca.
That's equal to say get the
pattern in this matter.
And here we are passing the object that is civil.
Now after we have passed the difference, we check here.
If our
pattern is the one which we are creating over here, that's pattern is and we say not in C all.
Now, here are all patterns we have created here above all patterns.
So if it is not in the given range over here, then we need to add into the old pattern.
So then we say all patterns, one at the index of puttanesca and that is equal to your word one.
OK, then then we go in for a spot here and here we see old
patterns.
In the index of black on the dot, we are finding that the value of.
OK, so if it is not in that if this doesn't equal to that, then you aren't adding or upending the
values.
So in this particular, Kotek writes this code that we have written into another file that we would
be creating now below that is the patterns not by five, which will contain one every or very, very
large assignment statements.
So now for creating that particular file, let's go back to Melody for Loop of one.
And here we are creating another file objects for one again.
We are giving here to open, but now we are giving a filename that is several patterns, one dot be
Vilo.
This file we are giving and this should be open for writable, which means we now want to write some
data into this particular file.
And what are we supposed to write it for one dot.
Right.
And here we are giving all.
Patterns is equal to this text would be printed and then we say, if we are not right, we give people
an object in B format.
OK, and here we print the value of all patterns, one that we already have created.
So this data would be then returned to the fight.
And finally, if you don't have to forget to close the file object anyways, once you lose that, then
we use name is equal to underscore in Alaska.
OK, and then we call the meaning.
OK, so now this particular file, we would be receiving it as c make war button one dot by.
So in a drive, we have the full python hacking advanced level in that we are saving this file.
OK, and now once we have saved this, we have to also copy the dictionary.
OK, so for that, we have simply copy pasted some of intermediate level and we have already created
this file and we have just sort of another advanced level code that we have the folder that we have
created.
Now, what we are supposed to do is we are supposed to execute this module and once we execute this
module, then we would get a file created.
If you look in your folder, you see this war pattern stop by file getting created.
Now, for example, if you want to open up this and check, OK, let's go here.
Civil backwards.
You can see this a lot number of data has been created for this, and this is how the pattern we are
getting and the data that we are getting from the dictionary to define, OK, so now we will be using
this file.
That is what pattern file that we have already created using the back and file.
So this file, dictionary file would be required and a paper clip file would be required.
Also the simple substitution file that we had created earlier in the intermediate level even that would
be required.
So using that, we would now create another program for hacking, a simple substitution cipher.
And see, we have also the substitution side for the that we had created in the intermediate level position.
OK, now, after doing all the things now, we would proceed here for creating a hackle program for
a simple substitution cipher.
So let's go back to our Python shell and we will create a new file here.
And the first thing we will create is import with Gamma, R E Gamma copy, then our paperclip, then
the folder on the file name that we have a substitution cipher table.
So we will create that.
OK, so substitution cipher demo then.
We want to create more patterns.
One.
And we also want to import that is our make or pattern one.