 Hi, this is Christian. So in this video, I'm going to go over the UNIS-6B assignment. This is the horse racing assignment. So the details here, I'm just going to read it very quickly here. So each year, Christian, her, the owner of a racing horse farms, enters four of his horses in five local horse races. He uses a table shown below. We'll look at the PDF in a minute to keep track of his horse's performances in each race. And the table, a one indicates that the horse has won the first place, a second indicates second place, a third indicates the third place, and a zero indicates that the horse did not win at all, still not finished at all. So let's look at the PDF. If you click on that one, you're going to get this file here. And let me maximize this a little bit. You can see, so here is a table here. So this is a 2D table or 2D list. It's a four by five table. The rows here, each row represents a horse. We just call it a horse number. So horse number one, two, three, and four. And each column here represents a race, a competition. So that the horse number one, for example, enters five races. And then if for each race, you can see the number here. So number zero indicates that my horse number one did not win the top three. So you get a zero for that one. The second race, it got first place, and then no place, third place, and second place. And the same for the rest. So this is an example of the table. You can build this table so that your application works. And you can also generate random tables or keep changing it. The only caveat is that if you look at these columns, you cannot have duplicates for one, two, or three. They cannot be duplicates because they can only be one first place, one second place, one third place. They can be many zeros because out of that, then there are a lot of horses that didn't make any of the top three. So zeros are allowed for the columns. Duplicates have been. So in this column here, for example, even column one, so I have zero here and then one here and there's no two. Well, that means that none of my horses actually got second place. So maybe Lily's horse got a second place or something. So that's what this means. And then your task is basically to build this table and then allow the user to pick one of the horses. And then you're going to tabulate the number of wins for that particular horse. So if I pick horse number two and count the number of zeros and ones and two or three's in there. So down here are some requirements. You need to have these at the minimum. So create a 2D list. I call it races, horse races or whatever you want to call it. It's fine. Create a function to generate this table. So you can actually manually create it. I also provide a started file that you can use. In that started file, I provide a random function that can generate a random table for you. You can study about it and then study and see how that works. So this function will return the race table and usually assign that to a variable called race. And then based on the result of the input, you're going to use this function, calculate wins, to calculate the number of wins for that particular horse. So you also have the option of allowing the user to select all five, all four horses. So if that's the case and you basically count all the ones and twos and threes and zeros in here, that's all for all your horses. So that's the two options here. That's what this means. If you click on the single horse, then you would need to look at the row and then store the result of those wins in a one-dimensional list. This is an easier way to do that. I recommend. But of course you can do it any way you want. You can use string however you want. But don't create like four variables, okay? It's okay for a small project like this, but usually that's not efficient. And the same here. Are you still going to use one-dimensional list to store the result? Like the position zero index zero could be the zero place. One is the first place, two second place, three and third place and so forth, right? And then you're going to create a function called display results. That's to print out the number of wins for that particular horse or all the horses. And your execution starts at the main function. This is known as the driver function. And so I just recommend I use these loops in there and if NL's branch in there to help you make selections and also include this in the top of your program every time for all your assignments, you should have this and just read with that. So down here is some simple runs, okay? So when you run the program, it should, you know, this latest table, this is the result already so that the user can know which one to pick. So in this example here, and the user picks number one, so that this is the row that we're going to calculate. And then the print result will display this box right here, right? This message. So the number of wins for the first place is you can see there's one here and then one here. So two of the races, the horse number one, one, two, or one first place, okay? And then in the one, the second place, one, two, and three rows, you get three second place. And then there's no third place or did not place that off for that horse, okay? And then I usually, you know, give it a continue if they want to read, read, do it again. And that's why you don't have to do that. But again, things you already learn, right? Loops already. So you can ask the user to do that until they either quit or they say no and then you quit. So the next one is gonna pick horse number three, okay? So notice now, I guess I'm using a random table. So the result would be different. It's not the same table here. If you're using the same table that you can see the same result, okay? So again, it's up to you. So this is like a different day, right? So look at number three and then same as above, same idea. And then the last one here is I wanna pick all horses. So if you select five, right here, five all horses and then all you have to do is basically count all the zeros, one, two and three in here and then, you know, tabulate them, add them up and, you know, I'll put them here. So these results is the one I mentioned about the one dimensional list to store that number of counts and it counts for each of those places, okay? So that's the sample run. Now I'm gonna show you the code. So here is the, let me clear this for a second here. This is the sample code I provided for you, the starter file, make sure you fill the top. And this one here is the random table. So notice I imported the random library so that I can generate a random number right here between the start, which is between zero and three. So these are the placements, right? So one, two or three or zero in all places. So, you know, study this function if you're interested and your generate runs, this is the required function you need to implement. So again, you can just use this if you want to, that's fine. Or you can build your table manually right in here and don't call this function, right? And just return your own table here, okay? And so if you build this again, I'll check, make sure there's no duplicates at all. So we can test this actually. Let me do this, put like g is equal to generate. Table, I'm not gonna invoke that. I just run so it stays in memory. If I put g here, you see that it, you know, builds the table. And if you were to display it nicely, there should be no duplicates for one, two and three on each column, okay? So that's what this is used for, okay? So now let's go over here and run the program. Just wanna show you one sample what it looks like. So here we go, you see that the columns is no one, two and three duplicates, okay? So that running table should fix that. If I quit now and then we just quit, okay? So again, you don't have to do that, but I think by this time you should be able to do that. So let's pick the horse number one. And again, I get two first place, two second place, one third place and then zero in the first place. And then just say yes, continue. And then let's pick five and then you count all the ones, right? So you have one, two, three, four, interesting. Four ones, four two, four threes and then eight zeros. Okay, and then just continue and then now we're done. All right, so if you have any questions, again, show me email, let me know. Otherwise I look forward to seeing your project. Thank you.