#!/usr/bin/env python #coding:utf-8 def f(x): if x%400 == 0 or x%4 == 0 and x%100 != 0: print ‘%s 是闰年‘ % x else: print ‘%s 是平年‘ % x year = raw_input(‘Please a year number:‘) year = int(year) f(year)
时间: 2024-10-29 19:06:21
#!/usr/bin/env python #coding:utf-8 def f(x): if x%400 == 0 or x%4 == 0 and x%100 != 0: print ‘%s 是闰年‘ % x else: print ‘%s 是平年‘ % x year = raw_input(‘Please a year number:‘) year = int(year) f(year)