Simple leap year calculation in Python