Sort by

recency

|

3025 Discussions

|

  • + 0 comments

    year= int(input()) if(year%4==0 and year%100!=0)or(year%400==0): print(year,"is a leap year") else: (year,"not a leap year") mine code is true but n the end there is a code which cant be erased so the submit code option is showing failure so did anybody have an idea?

  • + 0 comments

    def is_leap(year): leap = False

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

    year = int(input()) print(is_leap(year))

  • + 0 comments

    def is_leap(year): leap = False

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

    year = int(input())

  • + 0 comments

    def is_leap(year):

    leap = False
    
    # Write your logic here
    if(year%4==0):
        if(year%100==0):
            if(year%400!=0):
                leap= False
            else:
                leap=True
        else:
            leap=True
    
    else:
        leap= False
    return leap
    

    year = int(input()) print(is_leap(year))

  • + 0 comments

    def is_leap(year):
    return (True if (((year%4 == 0) and (year%100 != 0)) or (year%400 == 0)) else False)