Android & iPhone apps are coming soon. Log in for a plan and reminders made for you →

Coding basics · 4 of 20

Leap year

A year is a leap year if it's divisible by 4, except years divisible by 100, which are leap years only if also divisible by 400. Return True or False.

What you need

and is true when both sides are true; or when at least one is. != means "is not equal to". Use brackets to group conditions.

if (age >= 13 and age <= 19) or vip:
    return True

Examples

Input year = 2024

Output True

Input year = 1900

Output False

Divisible by 100 but not by 400.

Input year = 2000

Output True

Divisible by 400.

Your code · Python

Stuck?