# 输入某年某月,判断这一天是这一年的第几天
year = int(input("year:\n"))
month = int(input("month:\n"))
day = int(input("day:\n")) months = (0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334)
if 0 < month <= 12:
sum = months[month - 1]
else:
print('Date Error\n')
sum += day
leap = 0
# 判断是否为闰年
# 判断标准是:1、能被4整除且不能整除100;2、能整除400
# and 优先级高于 or
if (year % 400 == 0) or (year % 4 == 0) and (year % 100 != 0):
leap = 1
if (leap == 1) and (month > 2):
sum += 1
print(f'it is rhe the %dth day.' % sum)

最新文章

  1. FlowLayoutPanel
  2. LA 3644 X-Plosives
  3. poj3660 Cow Contest(Floyd-Warshall方法求有向图的传递闭包)
  4. ADO.NET帮助类DBHelper
  5. 【百度地图API】如何制作孪生姐妹地图?
  6. 网络协议TFTP
  7. 细说css中的position属性
  8. Oracle中的substr()函数 详解及应用
  9. 可持久化Trie
  10. linux下sublime输入中文
  11. Python+Selenium学习--自动化测试模型
  12. XXS level1
  13. yolov3源码分析keras(一)数据的处理
  14. Fast and Accurate Traffic Matrix Measurement Using Adaptive Cardinality Counting
  15. Js 中的 this
  16. SVN增加文件后,文件无法自动包括在项目中的原因
  17. Python 小知识点(7)--类的创建方式
  18. MATLAB入门学习(二)
  19. kafka搭建笔记
  20. vue2项目中better-scroll 插件使用时候页面不滚动

热门文章

  1. Sentinel熔断降级
  2. 2018.8.30 nowcoder oi赛制测试1
  3. Codeforces Round #533 C. Ayoub and Lost Array
  4. flutter兼论
  5. python网络编程TCP服务多客户端的服务端开发
  6. P1149_火柴棒等式(JAVA语言)
  7. 《逆向工程核心原理》——TLS回调函数
  8. 从源码剖析Go语言基于信号抢占式调度
  9. element Notification 通知文字换行小技巧
  10. Python基础(二十一):面向对象“类”第四课——魔法方法