pythonchallenge-15地址 : http://www.pythonchallenge.com/pc/return/uzi.html


使用python 3.x 对pythonchallenge-----15的解答过程

 题目解析:图片是一个月日历,1**6.1.26这个日期被圈出来了,然后看日历下方2月份是29天,很明显当年是润年。
在源代码中出现了<!-- he ain't the youngest, he is the second --> <!-- todo: buy flowers for tomorrow -->。就是说找到第倒数第二小的日期,然后日期的明天是一个重要日期
解题过程:
#http://www.pythonchallenge.com/pc/return/uzi.html

import datetime
import calendar


for i in range(1006,2016,10):

    t_str = str(i) + '-01-27'
    d = datetime.datetime.strptime(t_str, '%Y-%m-%d')
    if d.weekday() == 1 and calendar.isleap(d.year):
        print(t_str)

 答案:1756-01-27

1176-01-27
1356-01-27
1576-01-27
1756-01-27
1976-01-27

 通过百度查到  #沃尔夫冈·阿玛多伊斯·莫扎特(Wolfgang Amadeus Mozart,1756年1月27日-1791年12月5日)

答案就是 Mozart

 

 

相关文章:

  • 2021-06-24
  • 2021-08-07
  • 2021-12-02
  • 2021-07-14
  • 2022-03-06
  • 2021-08-13
  • 2021-06-09
  • 2021-09-22
猜你喜欢
  • 2022-03-08
  • 2021-10-12
  • 2021-07-12
  • 2021-12-10
  • 2021-12-11
  • 2021-05-18
  • 2022-03-03
相关资源
相似解决方案