python 案例问题答:这个有2个知识点 1、python 的bool类型,也就是True和False,实质上市int型,也就是1和0,即True==1,False = 0 2、 [[31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],[31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]][is_leap_year(year)]也就是函数返回...
用python找出1900~2021年中的闰年答:>>> [i for i in range(1900, 2021) if i%4 == 0 and (i%100 != 0 or i%400 == 0)][1904, 1908, 1912, 1916, 1920, 1924, 1928, 1932, 1936, 1940, 1944, 1948, 1952, 1956, 1960, 1964, 1968, 1972, 1976, 1980, 1984, 1988, 1992, 1996, 2000, 2004, 2008, ...