1 00:00:07,810 --> 00:00:13,390 Now it is time again for exercise, so I want you to do the following exercise. 2 00:00:13,720 --> 00:00:16,560 Imagine that you are a company. 3 00:00:16,630 --> 00:00:18,920 You want to hire programmers just like you. 4 00:00:19,600 --> 00:00:22,710 So there are few requirements for the programmers. 5 00:00:23,260 --> 00:00:25,840 So first of all, they need to have a master degree. 6 00:00:26,860 --> 00:00:30,160 So master degree. 7 00:00:31,660 --> 00:00:32,480 We require. 8 00:00:32,830 --> 00:00:33,290 OK. 9 00:00:33,640 --> 00:00:42,280 And also they need to have more than two years of experience. 10 00:00:43,300 --> 00:00:50,770 So I wanted to create an if statement that is chicken for both conditions, that you have a master degree 11 00:00:50,890 --> 00:00:51,510 or above. 12 00:00:51,520 --> 00:00:53,900 So you should also be fine, right? 13 00:00:54,580 --> 00:00:59,230 And also, you need to check if you have two years of experience. 14 00:00:59,500 --> 00:01:07,870 OK, so in case one of these things is not met, then you should say that the candidate is not suitable 15 00:01:07,870 --> 00:01:08,470 for the job. 16 00:01:08,750 --> 00:01:14,800 OK, so I will give you about five minutes to do this one, because I believe that you need to think 17 00:01:14,800 --> 00:01:17,470 of it, try to do it for five minutes. 18 00:01:17,470 --> 00:01:22,130 And if you cannot do it, please go back to that video and see my solution. 19 00:01:22,600 --> 00:01:25,930 OK, so the solution or code is simple. 20 00:01:25,930 --> 00:01:30,250 Actually, if you didn't do it exactly like I did, this is not a problem. 21 00:01:30,490 --> 00:01:37,060 As long as it works fine, because you can write your code in many different ways in all the. 22 00:01:37,060 --> 00:01:37,580 Correct. 23 00:01:37,600 --> 00:01:37,970 Right. 24 00:01:38,320 --> 00:01:47,020 So let's start, first of all, write one variable called degree equals input. 25 00:01:47,920 --> 00:01:52,920 And hearing this input, I will simply ask the user what is his degree. 26 00:01:52,930 --> 00:01:55,750 So what is your. 27 00:01:57,230 --> 00:02:01,680 Degree, obviously, in parentheses, and then let's write. 28 00:02:02,850 --> 00:02:03,630 M.. 29 00:02:05,700 --> 00:02:11,430 Bachelor or Ajda, OK, then. 30 00:02:13,010 --> 00:02:16,320 Let's ask our user to write his experience. 31 00:02:16,670 --> 00:02:20,130 Experience equals input. 32 00:02:20,600 --> 00:02:30,410 How many years of experience is do you have since we have this variable? 33 00:02:30,440 --> 00:02:32,160 Now it's time to create the statement. 34 00:02:32,570 --> 00:02:33,640 So let's write it. 35 00:02:36,180 --> 00:02:38,790 Degree is sequel to. 36 00:02:41,210 --> 00:02:43,400 Master or. 37 00:02:44,670 --> 00:02:54,990 Degree is equal to muster with small letters, with lowercase letters, so we ensure that we take both 38 00:02:54,990 --> 00:03:05,990 cases or we agree is equal to VTE or vagary is supposed to be HD. 39 00:03:06,570 --> 00:03:09,030 Then this means that our. 40 00:03:10,170 --> 00:03:14,800 Candidate has the right degree, right, if he has one of these. 41 00:03:15,570 --> 00:03:21,930 So since our candidate has the right degree, we would also like to check if he has the right experience. 42 00:03:22,470 --> 00:03:28,410 So for that reason, I would create one more if look here, which actually the combination of the two 43 00:03:28,560 --> 00:03:30,440 flubs is, quote, the nested loops. 44 00:03:30,810 --> 00:03:32,700 So that's a check for one of the conditions. 45 00:03:32,970 --> 00:03:34,900 Then you move on and check for the other one. 46 00:03:35,430 --> 00:03:36,360 So, all right. 47 00:03:36,360 --> 00:03:37,900 If int. 48 00:03:39,530 --> 00:03:45,320 Experience in here, I write in because I want the experience to be as an integer variable. 49 00:03:45,400 --> 00:03:45,820 OK. 50 00:03:46,830 --> 00:03:54,630 So if the experience is higher or equal to two years, then our candidate, he has the right experience 51 00:03:55,230 --> 00:04:00,180 and for that reason we can print to the candidate you are. 52 00:04:01,430 --> 00:04:05,600 Accepted for the interview. 53 00:04:06,200 --> 00:04:13,670 Now we have the best case scenario and we did properly, but now we need to see what's going to happen 54 00:04:13,670 --> 00:04:17,030 if the candidates don't have one of these conditions. 55 00:04:17,030 --> 00:04:17,320 Right. 56 00:04:17,930 --> 00:04:26,850 So let's right here else and here this else is for the second if looked right, because he's in the 57 00:04:26,870 --> 00:04:36,290 inner in the station level so else, which means that our candidate don't have experience higher or 58 00:04:36,290 --> 00:04:37,310 equal to three years. 59 00:04:37,310 --> 00:04:40,730 So else print you don't. 60 00:04:42,920 --> 00:04:43,370 Have. 61 00:04:45,170 --> 00:04:45,590 In the. 62 00:04:47,440 --> 00:04:53,930 Experience, right, and then if the candidates don't have the degree. 63 00:04:54,070 --> 00:04:59,830 So if you don't have the degree, then we'd like to write a statement else. 64 00:05:02,370 --> 00:05:04,590 Friends, you don't. 65 00:05:05,640 --> 00:05:16,350 Half the report IUT degree, and here I will just make the cosine double, because this is the way that 66 00:05:16,800 --> 00:05:18,220 we compare to objects. 67 00:05:18,240 --> 00:05:24,300 OK, so while this is them, let's run the coat and see what is going to happen here. 68 00:05:24,600 --> 00:05:32,850 So as you can see, the program is asking if you have a degree in what it is right here, master, then 69 00:05:32,850 --> 00:05:35,260 it will ask us how many years of experience do we have? 70 00:05:35,550 --> 00:05:42,870 I will write one here and you can see that we are prompted that we have only one year so we don't have 71 00:05:42,870 --> 00:05:44,180 enough experience for this job. 72 00:05:45,680 --> 00:05:47,190 Let's run the program once again. 73 00:05:47,450 --> 00:05:51,830 OK, let's see if what's going to happen if we don't have the right degree. 74 00:05:51,870 --> 00:05:54,470 So let's see if we have only a better degree. 75 00:05:54,680 --> 00:06:00,870 Let's say we have five years of experience and we can see that we don't have the required degree. 76 00:06:01,820 --> 00:06:03,620 And finally, let's make one case. 77 00:06:03,620 --> 00:06:04,280 That's correct. 78 00:06:04,280 --> 00:06:08,750 So we can test every object of our law, of our if statement. 79 00:06:09,230 --> 00:06:16,430 So I will right the degree be aged in the years of experience then. 80 00:06:17,990 --> 00:06:23,390 You can see that our program is saying that we are accepted for the interview, which means that everything 81 00:06:23,390 --> 00:06:23,950 works fine.