Leap year checker by Rahul

 def is_leap(year):

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

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

Comments

Popular posts from this blog

Function to get a no. before input no.