 Hey, what's up everybody welcome back to their Python programming video We're looking at the Python challenge moving on to you challenge number nine last one. We were looking at eight that was I was giving us a little picture of a bee and Giving us his hints to inflate user name and password and we use the B zip Module BZ2 and Python to kind of clear that one up for us and looking back I was laughing at it because well, well, let's see. Alright, let me get let me get to the page. I know it was a integrity It's funny because it's a picture of a bee Bees this is Beesip the bee zip to bees bees. I just thought that was clever and witty and the best thing so alright, we're We're on challenge number nine right now Yeah, so this one is giving us this picture some trees and Dots I don't know what to do. So alright, let's view a page source do some investigation The title of the page is connect the dots and I think that's the biggest hint that we're gonna get because there's nothing else on the page Connect the dots. Okay. Well, I Don't think it means these dots on the picture because Even if we did it it would not What do you think it would give us like I? Don't think it would give us anything That's not gonna form a word. It's not gonna form pictures. I don't know All right Nothing else in the page and then the image There's a little Disclaimer to see the solution for the previous level and the next big thing that I see is this comment first plus second equals question mark and First and seconds are these long lists of numbers So I'm kind of wondering if there's something we have to do with those If we add them to add the two together like first plus second is it referring to you look okay every index of The first add it to the index of the second that sort of thing That I could give us numbers or it could give us a new list, but what is the new list going to help us with It's not gonna. We're not gonna be able to put a whole list in the URL bar And notice that the length of the first list is even longer than the length of the second list So that's not gonna do much for us either If we were to like add them all together we could like Get the sum okay add everything together in this first list add everything together in the second list And then add those two numbers together. That's as if we were adding each individual number to each other in You know both of the lists. Let's I Feel like let's try that At least have some place to start so I'm just gonna copy this whole thing Get my text that are open And I'll just see this variable is first Making a ray for this thing and second second copy All right for this guy so we can add them all together with the simple function in Python called sum and If we add the sum of the first and the sum of the second What do we get? It'll be a big number, but all right. Let's let's take this number Or maybe this is what we need to do is paste this here. No That's not a thing. Okay. That's not it I really don't think we should be connecting these dots that the ones in the image just don't make sense to me Especially what what are these guys? It's a Ryan's belt over here But what else can we do I'm thinking like you know in the what was the eighth tutorial It was the seventh tutorial. Yeah, the seventh tutorial for oxygen, right? We didn't have any hints like on the page It just gave us an image and it had these like blocks on it We parsed through with the image module and because we were given an image so that made sense Do we have to do the same thing with this guy? Because I mean we're giving an image and it has a bunch of blocks But like look at all these blocks. They're not different colors They're not it's not like we can get any text out of them or any character values We got all these numbers and look at these numbers because these are pretty large like 304 381 these are gonna pass the They're gonna end up passing the 95 mark for like ASCII text so these must mean like actual like pixel values like Owners these are dots themselves But what does it mean by first plus second if you page source first plus second equals question mark? I'm just I'm gonna import Image because we're not gonna get anything out of this image, but I feel like we If we have to connect dots what if all of these numbers are dots, what if they are pixels? so and First plus second just means that okay add first and second together. So all all dots can equal first Plus seconds now if I print all dots is that gonna get me what I want. Yeah, okay, it's now 146 and it should end 136 does it end 136 it doesn't 136. Okay, so now we have all of our dots I'd like to kind of be able to Codepold the stuff because these are really long lines and now we got all of our dots and We'll use our image module to connect these Dots, I mean if that's what they even are on New image new image equal image dot new the type is gonna be RGB And it is gonna need a size. How big is this one? Copy image it's going to paint paint paste it in 640 by 487 I don't think It's a little bit bigger than what it needs to be That's it. Is it really that size? Yeah, it is. Wow All right, let's do 640 by 480. What about 640 does that work? So now I have a new image Okay, do I have to close this thing new image close? I honestly don't remember much of okay No, I don't I don't remember much of my image module Tutorial stuff. I don't really remember a whole lot of what to do with it But all right, so now we've got our new image I Feel like what we can do is for We can loop through all these dots for I in range of length Of all these dots so this way I'm using I so we can index them. So like if I were to print out all dots I Like you would see okay now we have all these dots and For a dot for a pixel, you know, you need an X and Y coordinate so I'm thinking the first value and the next one. I Don't know if we should be jumping between first and second Like for X is represented in the first array and Y is represented in the second array But that wouldn't make sense since first is longer than second So I feel like the first value and then the next value is X and Y So okay, we need to supply a step value then because we're going to use I representing to this current one and then The next one representing Y value if that makes any sense whatsoever so using we're stepping by two and Let's say X is equal Dots all dots I and Y can equal all dots I Plus one how does that make a little bit more sense? And what we'll do is we'll say new image. We can we can put a pixel on our new image To you know, like display a dot there and then we can pretty much connect them that way. So put pixel X and Y And then we're done Put pixel takes three arguments to give what does it take? I'm gonna uh I'm gonna hop online to look at my documentation image python image Put pixel color it takes a color Um 00 Zero 255 Oh, and I need to save it new image dot save I'm on my desktop right now. So hopefully it'll uh, okay, right The image is black by default So black is not gonna work for us. Let's go white 255 255 255 Save this run it What is that? What is that? um cows don't have uh Whoa, sorry. I'm using my touchscreen right now cows don't have horns Bulls have horns Is it a bull? Is that seriously what I'm supposed to take from this bull? I'm gonna do it. I'm gonna do it connect the dots Bull What it's seriously a bull Okay, okay, we did it. There it is guys so Okay, I mean The way that we went about it was certainly not the way that I expected but nor did I expect the answer to be a bull but All right, um, so yeah, we added these First and second hints like big long lists together Get all the dots and then we created a new image and then we just like Went through and parsed each of these dots as if they were pixels with their x and y coordinates corresponding and next to each other So we had to increment by two because we're adding this we're looking at this index and then the next one So we're going to have to skip over that next index So that's why we're using that step of two in our loop um And new image dot put pixel is what's going to put the pixel there and we're using white because by default The image background is black And then we saved it And then we open it up and it's a bull. So uh, there we are guys Hope you uh, hope you enjoyed this video and tutorial Oh, uh, if you are liking the series, maybe like the video. Maybe leave me a comment Maybe subscribe if you're feeling generous, but I mean it's all up to you guys. Thanks for watching. I'll see you in the next tutorial