1 00:00:00,420 --> 00:00:01,620 Hi, welcome back. 2 00:00:01,640 --> 00:00:09,310 In this lecture, we will complete hangmen game project, which we thought at last lecture. 3 00:00:09,330 --> 00:00:20,170 So let's begin after we bring the game name and the word chosen by the Python random module. 4 00:00:20,910 --> 00:00:27,090 Now we will create a new list called Result, composed of underscores. 5 00:00:27,210 --> 00:00:36,090 And after the game starts, it will replace those six and those goals by the correct letters of the 6 00:00:36,090 --> 00:00:47,340 correct word chosen by random module to be guessed by the player's result equal to empty square brackets. 7 00:00:47,730 --> 00:00:58,830 Then we will iterate over the player inputs as the following four underscore between two single codes 8 00:00:59,040 --> 00:01:08,340 and range word letters and make all the letters of the word chosen by random module and lowercase by 9 00:01:08,340 --> 00:01:20,610 adding that lower method to the random choice method that will make it easy to be matched with player 10 00:01:20,910 --> 00:01:21,620 inputs. 11 00:01:22,020 --> 00:01:31,170 Then inside the for loop we will add result blasts equal between two single code underscore to add six 12 00:01:31,170 --> 00:01:39,300 and the scores inside the result less to be replaced by the letter or the correct letters guessed by 13 00:01:39,570 --> 00:01:40,310 the player. 14 00:01:40,350 --> 00:01:48,870 Then, if the game is over using while loop as the following while not game over per game underscore 15 00:01:48,870 --> 00:01:50,070 over column. 16 00:01:50,070 --> 00:01:57,840 Inside the while loop we will add the code of the game events that happened when the game end. 17 00:01:58,110 --> 00:02:06,120 So all the upcoming code will be inside the while loop to be iterate until the game end. 18 00:02:06,540 --> 00:02:18,420 So user underscore getting equal input between two parentheses single codes gets a letter column, its 19 00:02:19,410 --> 00:02:23,750 close the single codes close the parentheses. 20 00:02:24,030 --> 00:02:35,610 This is the message that will be shown to the player after he gets a letter and aimbot it. 21 00:02:36,090 --> 00:02:40,080 So it will be entered to be shown on the screen. 22 00:02:40,230 --> 00:02:45,450 Now we will inform the player about the letters or the letter. 23 00:02:45,690 --> 00:02:51,090 They have guessed by using every statement as a follow. 24 00:02:51,360 --> 00:03:01,980 But before we do that, we will add the extra number ten step, which is iterate over the user aimbot 25 00:03:01,980 --> 00:03:06,460 to keep the game running until the game is over. 26 00:03:06,480 --> 00:03:19,860 So if the user underscore guessing end result column inside the statement brain between two parentheses 27 00:03:21,090 --> 00:03:28,030 F for main function for the string and two single codes. 28 00:03:28,140 --> 00:03:33,660 The letter you have guessed is between two brackets. 29 00:03:33,780 --> 00:03:38,250 User underscore getting these two lines of codes. 30 00:03:38,250 --> 00:03:43,050 Well, print to the letters that the players will guess. 31 00:03:43,830 --> 00:03:54,720 Then check if the guest letter by the player is right or wrong and added to the result list using for 32 00:03:54,720 --> 00:04:04,920 loop with the position Caywood plus range function as the following for position and range. 33 00:04:05,400 --> 00:04:17,610 Warde underscore letters between two parentheses of the range function and inside this for Loop we will 34 00:04:17,610 --> 00:04:27,900 add the following line letter equal guessing underscore word between two square brackets position and 35 00:04:27,900 --> 00:04:39,030 if the letters equal user underscore getting resolved between two square brackets position equal letters, 36 00:04:39,540 --> 00:04:43,020 then Brent is a message of wrong letter. 37 00:04:43,710 --> 00:04:52,350 If the player choose a wrong letters and the brand is a message of losing the game, if the player lose 38 00:04:52,350 --> 00:04:59,460 all their sexy tries, so tries minus equal one. 39 00:05:00,860 --> 00:05:06,910 After tries equals zero, which means a game is over. 40 00:05:07,200 --> 00:05:20,870 Or tries all the tries or attempt by the players, print the message of the game losing and the following 41 00:05:20,870 --> 00:05:21,530 print. 42 00:05:23,620 --> 00:05:26,620 Between two parentheses game over. 43 00:05:30,340 --> 00:05:33,990 You lose the game, try again later. 44 00:05:37,520 --> 00:05:41,210 So game over equal to also. 45 00:05:43,530 --> 00:05:53,040 Then join all the correct letters which replace the underscores in the results list as the following 46 00:05:53,580 --> 00:06:02,760 brand between two parentheses F and inside the two single codes, we add to curly brackets as the following. 47 00:06:03,000 --> 00:06:10,740 Then inside the two curly brackets, we will add our joint function as the following two double codes 48 00:06:10,950 --> 00:06:17,220 that join between two parentheses rizzle. 49 00:06:17,580 --> 00:06:30,040 Then the underscore between two single codes not end result column game underscore over equal true and 50 00:06:30,070 --> 00:06:34,760 the Brent between two parentheses and two single codes. 51 00:06:35,460 --> 00:06:38,150 You are a winner comma. 52 00:06:38,160 --> 00:06:39,890 Congratulations. 53 00:06:40,050 --> 00:06:51,180 Then make sure to Brent every shape of every tribe of the tribes of the players from hangmen underscore 54 00:06:51,180 --> 00:06:51,720 life. 55 00:06:52,710 --> 00:07:04,470 So we will import these shapes from the hangmen, underscore life dobi or module as the following from 56 00:07:04,470 --> 00:07:07,110 hangmen, underscore life and bought lives. 57 00:07:09,090 --> 00:07:18,480 And Brent, between two parentheses lives and between two square brackets, tries so drivers of lives 58 00:07:18,690 --> 00:07:21,480 will be presented as shapes. 59 00:07:22,140 --> 00:07:25,100 Then we will run the second part of our program. 60 00:07:25,110 --> 00:07:29,910 We get invalid or syntax error and the line number 13. 61 00:07:30,020 --> 00:07:36,030 So we will add line numbers by clicking on view then and we'll drop down. 62 00:07:36,060 --> 00:07:38,070 We will choose the line numbers. 63 00:07:38,070 --> 00:07:39,420 We add wrong words. 64 00:07:40,290 --> 00:07:51,330 So we will remove it, then run the code again, which is then after F F user, not F the user. 65 00:07:51,420 --> 00:08:00,810 So we get another error, which is due to single codes in the for loop headline number five. 66 00:08:00,810 --> 00:08:10,020 So we will remove those two single codes and run our code again and we get another error and the line 67 00:08:10,020 --> 00:08:12,110 number thirty two ends. 68 00:08:12,180 --> 00:08:15,630 For me it was joint training function. 69 00:08:15,630 --> 00:08:25,470 So we will replace the two single codes of the Fermi's function with the two double codes and run our 70 00:08:25,470 --> 00:08:31,430 code again and we will get another syntax error. 71 00:08:31,620 --> 00:08:39,980 We add one equilibrated, but if we want to add polin overwritten, we add two equal to double equilibrated 72 00:08:39,990 --> 00:08:46,730 to be polin and check if true or not, and it will run successfully. 73 00:08:46,860 --> 00:08:55,800 So I will try to play the game to test at the losing and winning phases as the following. 74 00:09:06,150 --> 00:09:09,300 At this point, we reached the end of this lecture. 75 00:09:09,750 --> 00:09:12,620 Hope you enjoyed this lecture and get all of that. 76 00:09:12,780 --> 00:09:14,080 Thank us for being here. 77 00:09:14,430 --> 00:09:15,930 And thanks for watching. 78 00:09:16,140 --> 00:09:17,810 See you next, Viju.