Sort by

recency

|

2866 Discussions

|

  • + 0 comments

    if (year%4==0 and year%100!=0): leap=True elif(year%400==0): leap=True else: leap=False return leap

    I think it's easy this way!!!
    
  • + 0 comments
    return (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0)
    

    i think its the optimal solution

  • + 0 comments

    if(year%400==0): leap=True else:
    leap=False

  • + 1 comment

    Who make this idiot web site , because if your code is right but the site show you wrong ,I think the developer don't know in the coding there lots of way to write a single purpose output

  • + 1 comment
    def is_leap(year):
        leap = [True if (year % 4 == 0 and year % 100 != 0 or year % 400 == 0) else False][0]
        
        return leap
    
    year = int(input())
    print(is_leap(year))