无他,唯手熟尔!

Enter the date and judge the day is which day of the year?

import datetime
def dayofyear():
    year = input("input year: ")
    month = input("input month: ")
    day = input("input day: ")
    date1 = datetime.date(year=int(year),month=int(month),day=int(day))
    date2 = datetime.date(year=int(year),month=1,day=1)
    return (date1-date2).days+1
赞(0) 打赏
未经允许不得转载:沙の志 » Enter the date and judge the day is which day of the year?

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

沙の志