Sort by

recency

|

2948 Discussions

|

  • + 0 comments

    def is_leap(year): # Write your logic here if (year%4==0): if (year%100==0): if(year%400==0): return True return False return True return False year = int(input()) print(is_leap(year))

  • + 0 comments

    year=int(input()) if year%4 == 0 or year%400 == 0: print('True') elif year%100 != 0: print('False')

  • + 0 comments

    Simple step by step

    def is_leap(year):
        leap = False
        
        # Write your logic here
        if year % 4 !=0:
            return False 
            
        elif year % 100 !=0:
            return True
        
        elif  year % 400 == 0:
            return True
            
        
        return leap
    
    year = int(input())
    print(is_leap(year))
    
  • + 0 comments

    Simple step by step

    def is_leap(year):
        leap = False
        
        # Write your logic here
        if year % 4 !=0:
            return False 
            
        elif year % 100 !=0:
            return True
        
        elif  year % 400 == 0:
            return True
            
        
        return leap
    
    year = int(input())
    print(is_leap(year))
    
  • + 0 comments

    return (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0)