CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
jackfrued

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: jackfrued/Python-100-Days
Path: blob/master/Day01-15/code/Day02/leap.py
Views: 729
1
"""
2
输入年份 如果是闰年输出True 否则输出False
3
4
Version: 0.1
5
Author: 骆昊
6
Date: 2018-02-27
7
"""
8
9
year = int(input('请输入年份: '))
10
# 如果代码太长写成一行不便于阅读 可以使用\或()折行
11
is_leap = (year % 4 == 0 and year % 100 != 0 or
12
year % 400 == 0)
13
print(is_leap)
14
15