【python练习题】程序4

# 题目:输入某年某月某日,判断这一天是这一年的第几天?
import time

year = input('输入年份: \n')
month = input('输入月份: \n')
day = input('输入日期: \n')

t = year.strip() + '-' + month.strip() + '-' + day.strip()
k = time.strptime(t,'%Y-%m-%d')
print(k.tm_yday)

猜你喜欢

转载自www.cnblogs.com/yelublue/p/8970852.html