 Hey everyone, welcome back to another Python challenge tutorial and video. This is your host, Root of the Null, and we're looking at challenge number 15. We just got done with 14 with this nice little kitty named Uzi, took us a while to kind of figure that one out and get here. But here we are, challenge 15. Now what's kind of presented to us is this image of a calendar, just doing some basic observations. It's obviously January and I guess there's Monday the 26th is circled. I don't know what year it is. I'm assuming this is for the year, like this one whole six. And it looks like this whole, I don't know whether or not it's a bullet hole or some kind of hole. It's covering up the other digits in the year, I think. So as usual basic investigation, let's check out the source, the page source. The title is Whom, Whom? So maybe the answer is supposed to be a name or a person. There's a hint here that says he ain't the youngest, he is the second. Don't entirely know what that means, but it probably is a hint or a clue to Whom or who or whoever the person is that we need to get an answer to. Okay, so it should be he, should be a guy then I guess, and he ain't the youngest, he is the second. So there's our image of the calendar here, screen15.jpg, and there's another comment that says here, to-do, buy flowers for tomorrow. So there's gotta be something special about today, I guess on the calendar being the 26th of January, whatever year this is as of Monday, and tomorrow being Tuesday, the 27th of this year in January. So, okay, let's try and build something in Python. I haven't done any tutorials on these guys yet, but actually, let me save a new file. 15.py, I haven't done any tutorials on these modules yet, but there are two that I know and they're pretty simple and hopefully you can look up some documentation for them. DateTime, work with date and time and calendar to work with other dates. So those are two that I know and will probably be able to help us out for us with this anyway. I don't know really where to begin other than trying to figure out a year, whatever this bullet hole is covering up. So, we can test if the 26th is a Monday, right, or like the 27th is a Tuesday, and then it'll give us some ideas for what year it is, right? Let's try it. We can do this with a loop. We can test for like multiple years and see if they are the correct year. So, four year in range, let's go, we know it's going to be a thousand and something, something, a six, so I'm just going to set this to zero and let's go up to as high as we can, 1996. That was when I was born, 1996, wow. And then, we can increment by ten because obviously if we're just going to go up like 16, 26, 36, and then eventually we'll get to 11 and it'll keep building and just filling these in between numbers. So, that's why we can increment by ten and just shorten the amount that our loop will go through. So, okay, now we can determine if this day, the 26th, is a Monday or anything, because that's going to be the 26th in January. So, that's a function in date time. We can actually create a date time object with date time. So, let's say if datetime.datetime, now it will pass in arguments for like the year and the month and the day and everything. So, it will pass in year, the month would be one, considering that's January, the first month, and the day, let's say the 26th, dot weekday. Now, weekday is another function that will return the value or like a numeric value depending on what day it could be. I don't know the documentation of when Sunday, like when the week starts. Let's google that, datetime, weekday, return the week, return the day of the week as an integer where Monday is zero and Sunday is six. Okay, so, okay, so yeah, zero would be Monday, one would be Tuesday, two would be Wednesday, et cetera, three Thursday and that sort of thing. So, if we're looking at Monday, 26th, we're testing if it's zero. And if that is the case, then we can print the year. Run this, bam, we got a lot of stuff. Okay, so, I kind of want to look through some of these dates. I don't know exactly what I'm going to do with them though. What is that other hint that it said? View page source. He ain't the youngest, he is the second. Okay, so, youngest throughout our period of time would mean that the latest year that the guy's age, he would be the youngest if he were born at this latest year. It's 1976, but he's not the youngest, he is the second. So, 1846. Something about 1846. What can we gain from 1846? January 26, January, January 26, 18, what is it, 56? 46, 1846, crap, 1846. Benjamin Franklin, ooh, Benjamin Franklin Keith, Franklin, Ben Franklin, Benjamin, not the heck, this doesn't look good. What's Ben? Nope, crap, none of these. What's the other hint? Buy flowers for tomorrow. Oh, okay. We should test for, the other date, we should test for, what day was it? Tuesday, Tuesday the 27th. So, January 27th, if that's a Tuesday, a weekday would equal one rather than zero. So, if we run this, hey, pretty sure this is the exact same output. Okay, let's go with 1846, and, but now, okay, now it would be January 27th. Letter to William, holy crap, who was born on January 27th? This page is going to load. Garrison, William Lloyd Garrison. Garrison, Clark, second guy, Clark. Oh, Howie, how, Charlie how, that doesn't work either. What the heck? Four laws, 1846. So Robert Peel, Peel? I don't know what to do. Let's look at our code. For a year in 2006 to 1996, the reason we set that up was because of this hole. Because we don't know the two digits. Daytime, daytime, year is all this. I'm going to zoom this in since you guys don't need all this white space, this empty white space. I'm testing for January 27th, if it's a Tuesday. Oh, oh, years, right? We're forgetting about leap years. Right? Does this take into account leap years? The calendar function, I know has something about leap years. Calendar, leap year. I know it has something about leap years. Is leap year? Return is true if year is leap year, otherwise false. Okay, so we can test if, if we get the correct year, if we get a year that has a Tuesday, January 27th, just if calendar dot is leap year. So if that year is a leap year, what we'll do is we'll print out leap and then the year. Let's just see which leap years we have. Leap year, 1976. Okay, so the other one that we were seeing earlier, and then 1756. 1576, 1311, 76. Our hint was, he ain't the youngest, he is the second. But we're still on, we're still on Tuesday. We should change it back to, that's what it was, right? Yeah, Monday the 26th. So if we run this, we still get the same thing, 1756. So that, that's the year that we must want. I'll close out of Leasing, get back to Google. January 26th. It was 1756, 1756 being the second. Okay, this is a map of the world. Bank of Marin, Wolfgang Amadeus Mozart. Whoa, Wolfgang Amadeus Mozart, he's a person. He was born on the 27th of January, 1756. Oh, that's Tuesday, that's the day right after, right? Yeah, see, look here, Tuesday, January 27th. And if we had that in, it would still give us 1756, that's still leap year. Are you kidding? Wolfgang Mozart. How about just Mozart? How about just Mozart? Oh, okay, we did it. Found the answer. Now on challenge 16, that's awesome, sweet. Okay, so it was Mozart. How come? I thought we were looking at the 26th of Monday, Monday, 26th, January, apparently 1756. Why the 27th? Oh, yeah, in the source it gave us this hint, to do by flowers for tomorrow. Because it's someone's birthday, heck yeah, that's awesome. Okay, so we figured it out. The next challenge, the 16th, we can get to it with the URL, Mozart. Aw, yeah. Thanks for watching everybody, that one was pretty cool. There's a little bit more investigative and research and mind games, other than a lot of code like the last one. But this one, huh, you'd never have thought, I don't know, I guess leap years, that way we can get the second, because that's right, we were looking at the other one, the others that we were looking at, we looked at years, as well as leap years. So we looked at 1846 thinking that he's not the youngest, but he's the second, so the second year, that has a Tuesday, January 27th, but we should have been looking at leap years, rather than just regular years, or including leap years. I don't know, whatever we did, we got an answer, and we're on challenge number 16, that's awesome. So we're done, we're good. Thanks for watching everybody, hope you enjoyed this. If you did like the video, maybe do me a favor and like the video. Leave me some constructive criticism in the comments, and if you're feeling generous today, maybe subscribe, I'd love that. Thanks for watching everybody, I'll see you again.