On 02/22/2012 08:54 PM, Michael Lewis wrote:
On Wed, Feb 22, 2012 at 2:52 PM, Dave Angel<[email protected]>  wrote:
<SNIP>

I actually have a function written in my imported file to check if
a string is a valid float, but I didn't use it because I also have
raw_input in that same function, which I don't want. I'll rework the
imported function to remove the raw_input and put that in a function by
itself so I can utilize the valid float try/except that I've already
written.


That alone is a valuable lesson. When writing functions, try to make each function do one task, thoroughly and flexibly. Then it's much more likely to be reusable.


--

DaveA
_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to