lesson to learn

Irmen de Jong irmen at -nospam-remove-this-xs4all.nl
Wed Jul 7 19:57:13 EDT 2004


David R. Stockwell (wg-xiao) wrote:

> def fcn(day):

you could add the following line here:

      assert type(day) is int, "day must be int"

or:
      if type(day) is not int:
          raise TypeError("day must be int")

>    print "day is ", day
>    if (day < 10):
>       print "day is less than 10"
>    else:
>       if  day < 20 :
>           print "day is less than 20 but greater than 10"

--Irmen



More information about the Python-list mailing list