Answer:
def leap_year_check(year):
return if int(year) % 4 == 0 and (int(year) % 100 != 0 or int(year) % 400 == 0)
Explanation:
The function is named leap_year_check and takes in an argument which is the year which we wish to determine if it's a new year or not.
int ensures the argument is read as an integer and not a float.
The % obtains the value of the remainder after a division exercise. A remainder of 0 means number is divisible by the quotient and a remainder other wise means it is not divisible by the quotient.
If the conditions is met, that is, (the first condition is true and either the second or Third condition is true)
the function leap_year_check returns a boolean ; true and false if otherwise.
Wait what is the question? All you are saying is a fact. :|
Answer:
The answer is "Block scope".
Explanation:
In the programming, the scope is a code, in which it provides the variable ability to exist and not be retrieved beyond variable. In this, the variables could be defined in 3 locations, that can be described as follows:
- Inside a method or the block, which is also known as a local variable.
- Outside of the method scope, which is also known as a global variable.
- Defining parameters for functions known as formal parameters.
This actually happened to me when I was supposed to be an expert. Answer one more question, log out and back in, and then you should be the next rank!
Hope this helps! Have a happy holiday!