[Tutor] Leap years

Gerrit Holl gerrit@nl.linux.org
Sun Jan 12 16:53:02 2003


Don Arnold schreef op zondag 12 januari om 19:24:22 +0000:
> def isLeapYear(year):
>     if year passes test for a leap year:
>         return 1
>     else:
>         return 0

I think it's better to use True and False here.
Instead of "return 1", "return True".
Instead of "return 0", "return False".

It's boolean what's being expected from this function; not an integer.
It's not natural to return an integer, as it's not natural to return
a empty or non-empty sequence.

yours,
Gerrit.

-- 
Asperger Syndroom - een persoonlijke benadering:
	http://people.nl.linux.org/~gerrit/
Het zijn tijden om je zelf met politiek te bemoeien:
	http://www.sp.nl/