逃兵 发表于 2020-12-18 09:25:56

import datetime as dt
year = int(input('year:'))
month = int(input('month:'))
day = int(input('day:'))
days = dt.datetime(year,month,day)-dt.datetime(year-1,12,31)
print(days.days)

一块钱赫赫 发表于 2021-2-16 21:15:02

year = int(input("请输入哪一年份:"))
month = int(input("请输入哪一个月份:"))
day = int(input("请输入哪一天:"))
months =
if 0 < month < 12:
    if year % 400 == 0 or (year % 4 == 0 and year % 100 != 0):
      if month > 2:
            sum = months + day + 1
    else:
      sum = months + day
    print(sum)
else:print("请输入正确的年份")
页: 1 2 3 4 5 6 [7]
查看完整版本: Python:每日一题 4