"Joe Ohmer" <ohme...@mymail.nku.edu> wrote
The following code works well but I don't understand why the mysteryEffect code block changes the picture. Doesn’t 64*(r/64) just equal r?
That dependfs on which version of Python you use. In earlier versions '/' meant integer division so (1/64) * 64 => 0 * 64 (120/64) * 64 => 1 * 64 (128/64) * 64 => 2 * 64 (130/64) * 64 => 2 * 64 So only in the case of exact multiples of 64 does it do what you expect. However, if you have a recent version of Python (2.6? onwards) '/' means floating point division so now you get the result you expect (subject to rounding error) HTH, -- Alan Gauld Author of the Learn to Program web site http://www.alan-g.me.uk/ _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor