【原创】pythonchalleng——第15题
来源:互联网 发布:智能卡算法工具 编辑:程序博客网 时间:2024/06/15 02:07
第十五题的网址:http://www.pythonchallenge.com/pc/return/uzi.html,下面是该题目的截图,特此留念。
# coding:utf-8__author__ = 'hengha'import calendar,datetime
def dealDate(start, end, month, day, weekday):result=[]for i in range(start,end,10):d=datetime.date(i, month, day)if d.isoweekday()==weekday and calendar.isleap(i):
result+=[d.year]return result
if __name__ == '__main__':res=dealDate(1006, 1996, 1, 26, 1)newdate=datetime.date(res[-2],1,27)print newdate
# the birthday of Mozart
res中保存的就是满足前三条要求的所有年份,由于"he ain't the youngest, he is the second",所以我们利用res[-2]取出倒数第二个年份,那就是1756。再根据最后一条提示,我们得到的日期就是1756-1-27。这是什么日子呢?百度一下,得到答案:Mozart的生日。好了,试一试http://www.pythonchallenge.com/pc/return/Mozart.html,得到的结果居然是网页不存在……把M小写试一试,嗯,这就对了。http://www.pythonchallenge.com/pc/return/mozart.html。OK,顺利进入第16题。
0 0
- 【原创】pythonchalleng——第15题
- 【原创】pythonchalleng——第0题
- 【原创】pythonchalleng——第1题
- 【原创】pythonchalleng——第3题
- 【原创】pythonchalleng——第4题
- 【原创】pythonchalleng——第5题
- 【原创】pythonchalleng——第6题
- 【原创】pythonchalleng——第7题
- 【原创】pythonchalleng——第8题
- 【原创】pythonchalleng——第9题
- 【原创】pythonchalleng——第10题
- 【原创】pythonchalleng——第11题
- 【原创】pythonchalleng——第12题
- 【原创】pythonchalleng——第13题
- 【原创】pythonchalleng——第14题
- (原创)VC开发小技巧——第一篇
- JI——第200篇原创博文
- 写在前面——第一篇原创博客
- 提交复杂格式json数据
- 【原创】pythonchalleng——第14题
- 函数派发方式
- get中文乱码/post
- js基本排序算法
- 【原创】pythonchalleng——第15题
- Apache RocketMQ4.0.0
- 弹出框,承载弹出链接----页面,显示大图
- 【自我反思】项目成长能力锻炼,而我自身的技术点又该何去何从?
- 一道让我无地自容的百度面试题
- 关于参数传递接受@RequestBody 写的位置不同决定返回list还是单个实体
- 一道C++的笔试题
- python所有库
- disabled、readonly用法(无法向服务器传值的解决办法)