resister,神雕之帝王再生,ca1343航班
判断一个日期的所在月份有多少天?
# coding = utf8 date = '2000-02-08' s = date.split('-') year = int(s[0]) month = int(s[1]) day = int(s[2]) # print(year) # print(month) # print(day) days = 0; if month in (1, 3, 5, 7, 8, 10, 12): days = 31 elif month in (4, 6, 9, 11): days = 30 elif month == 2: if (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0): days = 29 else: days = 28 else: print("出错") print(date+'当月天数为'+str(days))
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
Python爬虫:Request Payload和Form Data的简单区别说明
浅谈Python中threading join和setDaemon用法及区别说明
Python3-异步进程回调函数(callback())介绍
python继承threading.Thread实现有返回值的子类实例
Python中使用threading.Event协调线程的运行详解
网友评论