1 00:00:00,660 --> 00:00:07,340 Welcome to the next session in this post, we will be creating the vote, but don't start the right 2 00:00:07,620 --> 00:00:10,050 now for that we are creating a fight. 3 00:00:10,050 --> 00:00:15,570 After executing that fight, we will get the vote back and start my fight created. 4 00:00:15,990 --> 00:00:19,140 And that would be based on the votes in our dictionary file. 5 00:00:19,170 --> 00:00:20,010 That is a dictionary. 6 00:00:20,280 --> 00:00:26,340 They will have to please this fight that we will be creating in the folder where you have a dictionary 7 00:00:26,350 --> 00:00:35,070 dot the OK, so first thing is we would go for a file and say new file and here we would import separate. 8 00:00:36,240 --> 00:00:41,130 Now we are going to define your C get your. 9 00:00:42,760 --> 00:00:47,510 Factum Astraea there to vote as the parameter. 10 00:00:47,920 --> 00:00:53,670 Now here, this will basically return a string of partan form of the given vote, for example, like 11 00:00:53,710 --> 00:00:59,060 if you have zero point one point two point three point four point one point two point three point five 12 00:00:59,060 --> 00:00:59,620 point six. 13 00:00:59,860 --> 00:01:02,560 So it could be something like a Dustbuster or something like that. 14 00:01:02,800 --> 00:01:11,920 OK, so if we see Vore is equal to say, vote of God can look to Apple, then we create here the next 15 00:01:12,410 --> 00:01:14,410 one that is equal to zero. 16 00:01:14,800 --> 00:01:24,490 OK, then we create letters, number one, that is also equal to blank and silver pattern. 17 00:01:27,060 --> 00:01:37,530 One, that it was OK, then we ran a form of saying, see, now we're creating the one in vote that 18 00:01:37,530 --> 00:01:48,570 we have created the object of OK, and we check if our lack of one is not in the letter number one, 19 00:01:49,330 --> 00:01:51,000 then what are you supposed to do? 20 00:01:51,030 --> 00:02:01,230 So here we are saying let's number one at the index of letter one is equal to convert Wistia now ridicule 21 00:02:01,240 --> 00:02:04,150 the value of Nexium. 22 00:02:04,550 --> 00:02:06,960 OK, next number, for example. 23 00:02:06,990 --> 00:02:09,580 So now what are we doing here next month? 24 00:02:09,600 --> 00:02:12,470 And is capital OK? 25 00:02:12,600 --> 00:02:15,180 So after this, what are we trying to do then? 26 00:02:15,180 --> 00:02:20,010 We see the value of the next number one plus is equal to one. 27 00:02:20,100 --> 00:02:23,510 And after that, below the if we see the word 28 00:02:26,370 --> 00:02:35,950 pattern one dot we are spending in that the letter number one in the back of or in the index of left 29 00:02:36,030 --> 00:02:45,810 over after we have completed with this, then the last thing we give you a written statement saying 30 00:02:45,810 --> 00:02:52,680 God, then we join in that the value of more than one. 31 00:02:53,490 --> 00:02:58,720 OK, now once we have completed this, we will define the mean method below. 32 00:02:58,920 --> 00:03:01,800 And in this we are creating say all. 33 00:03:03,800 --> 00:03:10,550 Patterns one is equal to blank, and we create a full one or file object one. 34 00:03:10,640 --> 00:03:17,750 Now we are opening the file that we have on which in which we are supposed to see if this that is dictionary 35 00:03:17,750 --> 00:03:24,410 dot the fight, because this file, we would open it and then we would split this file and get the pattern 36 00:03:24,410 --> 00:03:26,190 of each string and they would list. 37 00:03:26,480 --> 00:03:32,810 So over here, after giving that file reference in the file object, we see the world list. 38 00:03:32,810 --> 00:03:41,210 One object is equal to the file object dot receive, read it and split the file wherever you find a 39 00:03:41,330 --> 00:03:41,990 new line. 40 00:03:42,170 --> 00:03:49,130 So that new line would split one line into your particular fight after you have done that. 41 00:03:49,250 --> 00:03:58,820 Don't forget to close the file object and then Vidana for loop for civil one in your word list one. 42 00:04:00,080 --> 00:04:05,000 OK, and in this or loop we say we get the pattern for each string in this. 43 00:04:05,280 --> 00:04:07,640 So we create here puttanesca. 44 00:04:08,000 --> 00:04:10,760 That's equal to say get the 45 00:04:13,850 --> 00:04:16,240 pattern in this matter. 46 00:04:16,550 --> 00:04:21,120 And here we are passing the object that is civil. 47 00:04:22,310 --> 00:04:25,540 Now after we have passed the difference, we check here. 48 00:04:26,090 --> 00:04:27,740 If our 49 00:04:30,800 --> 00:04:38,900 pattern is the one which we are creating over here, that's pattern is and we say not in C all. 50 00:04:39,920 --> 00:04:45,650 Now, here are all patterns we have created here above all patterns. 51 00:04:46,220 --> 00:04:53,080 So if it is not in the given range over here, then we need to add into the old pattern. 52 00:04:53,390 --> 00:05:05,140 So then we say all patterns, one at the index of puttanesca and that is equal to your word one. 53 00:05:05,600 --> 00:05:12,980 OK, then then we go in for a spot here and here we see old 54 00:05:16,070 --> 00:05:16,820 patterns. 55 00:05:17,930 --> 00:05:24,980 In the index of black on the dot, we are finding that the value of. 56 00:05:26,510 --> 00:05:32,090 OK, so if it is not in that if this doesn't equal to that, then you aren't adding or upending the 57 00:05:32,090 --> 00:05:32,480 values. 58 00:05:33,110 --> 00:05:38,900 So in this particular, Kotek writes this code that we have written into another file that we would 59 00:05:38,900 --> 00:05:45,260 be creating now below that is the patterns not by five, which will contain one every or very, very 60 00:05:45,260 --> 00:05:46,940 large assignment statements. 61 00:05:47,180 --> 00:05:53,390 So now for creating that particular file, let's go back to Melody for Loop of one. 62 00:05:53,420 --> 00:05:57,580 And here we are creating another file objects for one again. 63 00:05:57,590 --> 00:06:06,410 We are giving here to open, but now we are giving a filename that is several patterns, one dot be 64 00:06:06,410 --> 00:06:06,770 Vilo. 65 00:06:06,770 --> 00:06:12,710 This file we are giving and this should be open for writable, which means we now want to write some 66 00:06:12,710 --> 00:06:15,530 data into this particular file. 67 00:06:15,860 --> 00:06:19,090 And what are we supposed to write it for one dot. 68 00:06:19,290 --> 00:06:19,880 Right. 69 00:06:20,240 --> 00:06:22,130 And here we are giving all. 70 00:06:23,730 --> 00:06:33,240 Patterns is equal to this text would be printed and then we say, if we are not right, we give people 71 00:06:33,240 --> 00:06:36,000 an object in B format. 72 00:06:38,720 --> 00:06:45,740 OK, and here we print the value of all patterns, one that we already have created. 73 00:06:46,080 --> 00:06:49,000 So this data would be then returned to the fight. 74 00:06:49,410 --> 00:06:57,600 And finally, if you don't have to forget to close the file object anyways, once you lose that, then 75 00:06:57,900 --> 00:07:04,970 we use name is equal to underscore in Alaska. 76 00:07:05,220 --> 00:07:07,850 OK, and then we call the meaning. 77 00:07:08,380 --> 00:07:17,550 OK, so now this particular file, we would be receiving it as c make war button one dot by. 78 00:07:19,010 --> 00:07:25,100 So in a drive, we have the full python hacking advanced level in that we are saving this file. 79 00:07:25,340 --> 00:07:30,260 OK, and now once we have saved this, we have to also copy the dictionary. 80 00:07:31,370 --> 00:07:38,300 OK, so for that, we have simply copy pasted some of intermediate level and we have already created 81 00:07:38,300 --> 00:07:44,540 this file and we have just sort of another advanced level code that we have the folder that we have 82 00:07:44,540 --> 00:07:44,970 created. 83 00:07:45,480 --> 00:07:51,620 Now, what we are supposed to do is we are supposed to execute this module and once we execute this 84 00:07:51,620 --> 00:07:54,130 module, then we would get a file created. 85 00:07:54,530 --> 00:07:59,680 If you look in your folder, you see this war pattern stop by file getting created. 86 00:08:00,170 --> 00:08:05,290 Now, for example, if you want to open up this and check, OK, let's go here. 87 00:08:05,390 --> 00:08:06,560 Civil backwards. 88 00:08:08,660 --> 00:08:16,100 You can see this a lot number of data has been created for this, and this is how the pattern we are 89 00:08:16,100 --> 00:08:22,850 getting and the data that we are getting from the dictionary to define, OK, so now we will be using 90 00:08:23,150 --> 00:08:23,890 this file. 91 00:08:24,080 --> 00:08:29,720 That is what pattern file that we have already created using the back and file. 92 00:08:30,020 --> 00:08:34,910 So this file, dictionary file would be required and a paper clip file would be required. 93 00:08:34,910 --> 00:08:40,280 Also the simple substitution file that we had created earlier in the intermediate level even that would 94 00:08:40,280 --> 00:08:41,360 be required. 95 00:08:41,630 --> 00:08:47,600 So using that, we would now create another program for hacking, a simple substitution cipher. 96 00:08:49,110 --> 00:08:55,920 And see, we have also the substitution side for the that we had created in the intermediate level position. 97 00:08:56,200 --> 00:09:02,180 OK, now, after doing all the things now, we would proceed here for creating a hackle program for 98 00:09:02,180 --> 00:09:04,100 a simple substitution cipher. 99 00:09:04,610 --> 00:09:09,090 So let's go back to our Python shell and we will create a new file here. 100 00:09:09,110 --> 00:09:19,550 And the first thing we will create is import with Gamma, R E Gamma copy, then our paperclip, then 101 00:09:20,030 --> 00:09:24,040 the folder on the file name that we have a substitution cipher table. 102 00:09:24,770 --> 00:09:25,990 So we will create that. 103 00:09:26,390 --> 00:09:32,900 OK, so substitution cipher demo then. 104 00:09:33,020 --> 00:09:36,500 We want to create more patterns. 105 00:09:36,500 --> 00:09:36,840 One. 106 00:09:36,860 --> 00:09:42,140 And we also want to import that is our make or pattern one.