> If I have a set of numbers, or strings etc. which have been generated > and I then want to do something with them, for example a sum function > call. Is the best way to put those items in a list, or similar > container, before applying the function.
The best design tips I could give is not to optimize early. Choose the way which is the easiest to implement first, if for example, that simple solution doesn't solve the problem satisfyingly enough (e.g. it's not fast enough) then you find alternatives. Whether you should use a number and add them over and over or make a list then use sum is not a problem, choose one which feels most natural to you and the program you're writing. _______________________________________________ Tutor maillist - [email protected] http://mail.python.org/mailman/listinfo/tutor
