Sort by

recency

|

2901 Discussions

|

  • + 1 comment

    what is the problem in this function my one test case is gettiing failed

    def is_leap(year): leap = False

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

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

  • + 1 comment

    def is_leap(year): leap = False

    if year%4==0:
        if year%100 == 0:
            if year%400 == 0:
                return True
            else:
                return leap
        else:
            return True
    else:
        return leap
    
  • + 1 comment

    Help me what"s wrong with this code bcg it become pass when i test it but stuck when i submit with failure odf Test case 1

    def is_leap(year): if year % 4 == 0 and 1900<=year<=10**5: return "True" if year%100==0: return "True" if year%400==0: return "True" else: return "False"

    else:
        return "False"
    

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