In what concerns the continuous evaluation solving exercises grade during the semester, you should submit until 23:59 of October 25th
(this exercise will still be available for submission after that deadline, but without counting towards your grade)
[to understand the context of this problem, you should read the class #03 exercise sheet]


In this problem you should submit a function as described. Inside the function do not print anything that was not asked!

The name of the .py source file you submit to Mooshak should NOT start with a digit (you will get an error if you submit it like that).

[IP027] Like the frog, get it?

A year is considered a "leap year" if it is divisible by 4, except when it is both a multiple of 100 and not divisible by 400.

The Problem

Write a function leap(y) that, given a year y, returns True if y is a leap year, and False otherwise.

Constraints

The following limits are guaranteed in all the test cases that will be given to your program:

1 ≤ y ≤ 5000       The year to compute

Example Function Calls Example Output
print(leap(2000))
print(leap(1900))
print(leap(2019))
True
False
False

Introduction to Programming (CC1024)
DCC/FCUP - University of Porto