[Tutor] Re: recursion sort of

Alan Gauld alan.gauld@blueyonder.co.uk
Fri May 30 19:35:01 2003


From: "David Broadwell" <dbroadwell@mindspring.com>
> > n1=int(n1*2*w1)    #what is this 'int' thing?
> int() = integer()

Which is to say that it converts the floating point 
(or Real Number) result into an Integer result.

If you want more control you can 'import math' and use
math.floor() and math.ceil() to round up or down in 
the direction you prefer.

Alan G
Author of the Learn to Program web tutor
http://www.freenetpages.co.uk/hp/alan.gauld