We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Introduction
- Write a function
- Discussions
Write a function
Write a function
Sort by
recency
|
3051 Discussions
|
Please Login in order to post a comment
This is correct code and it can also pass the hidden test
As per the requirement I've created a function and satisfy the possible condition that question mention but I'm confused in this part (This means that in the Gregorian calendar, the years 2000 and 2400 are leap years, while 1800, 1900, 2100, 2200, 2300 and 2500 are NOT leap years.) Here we need to apply some condition
def is_leap(year): return (year % 400 == 0) or (year % 4 == 0 and year % 100 != 0)
year = int(input()) print(is_leap(year))
def is_leap(year): leap = False
def is_leap(year): leap = False