Skip to content

Commit

Permalink
reformatted
Browse files Browse the repository at this point in the history
  • Loading branch information
Muna-S committed Jan 11, 2025
1 parent 157a3ee commit d2529c2
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions solutions/leap_year.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@
and if it is divisible by 100, it must also be divisible by 400.
"""


def leap_year(year: int) -> bool:
"""
Checks whether the given year is a leap year.
Argument:
year, a positive integer
Returns:
boolean: True if the year is a leap year, false otherwise.
Examples:
Examples:
>>> leap_year(2024)
True
>>> leap_year(1900)
Expand All @@ -31,5 +32,5 @@ def leap_year(year: int) -> bool:
raise ValueError("Year must be an integer")
if year < 0:
raise ValueError("Year must be positive integer")
return (year % 4 == 0 and (year % 100 != 0 or year % 400 == 0))

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

0 comments on commit d2529c2

Please sign in to comment.