Python Challenge level 15: “whom?”
Level 15. I didn’t like this one. Not a bit. I think it’s the only level not as well designed as the rest. At least up untill now. Either that or my mindset doesn’t like some types of riddle as much as the rest. We are given a date in a callendar and a couple of hints.
Hint 1: he ain’t the youngest, he is the second
Hint 2: todo: buy flowers for tomorrow
Hint 3: whoever it is has something to do with a leap year, between 1006 and 1996 in which Jan 26 was Monday
I could easily generate some dates with the appropiate constraints, but the problem didn’t seem narrower. I had to read the forums for ideas. At first I was tricked by the image because it seemed to have just one digit missing in the year. I believe this was intentional. The hint about the flowers could mean many things: a death, a marriage, a birth…
So to the forums it is. These are excellent by the way, although by the absence of recent posts I think I’m tha last guy on Earth playing the game. Everybody seems to have finished long ago. The threads are classified by challenge level, no spoilers are allowed and there’s a lot of valuable hints. After reading the forums, I got some things straight.
Fact 1: the year is between 1006 and 1996. This narrows the thing a lot.
Fact 2: birth day is Jan 27. Better go to Wikipedia to get a list of events that happened that day.
#!/usr/bin/env python
import datetime,calendar
for year in range(1006,1996,10):
d=datetime.date(year, 1, 26)
if d.isoweekday() == 1 & calendar.isleap(year):
print d
1176-01-26
1356-01-26
1576-01-26
1756-01-26
1976-01-26
The second youngest would have been born on 1756. Since it’s the next day, 1756-01-27. After going to Wikipedia there is finally an answer, Mozart. And that’s that. Im glad it’s over. Now to Level 16.
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
I believe you want to say that the year is between 1006 and 1996? The code matches, but it’s wrong in the “Fact” part.
Thanks. Good catch! I’ve just fixed the issue.
Where did you get the hint that it was a leap year?
Without that hint, I ended up with a longer list:
[1046, 1176, 1226, 1356, 1446, 1576, 1626, 1756, 1846, 1976]
and searched both 1176 and 1846 to no avail…
The calendar shows a thumbnail of February with 29 days ;-)
…and a minute after having posted my question, it came clear to me that I could take a look at the little February calendar on bottom right…
Ok, better next time, if only I could guess how to set Level 16 straight.