Thread: def my_abs()?
View Single Post
Old Mar 1st, 2005, 7:59 PM   #6
Fred
Programmer
 
Fred's Avatar
 
Join Date: Feb 2005
Posts: 67
Rep Power: 4 Fred is on a distinguished road
Quote:
Originally Posted by arod199113
in other programs is "def" necessary?
Well, it is all about code reuse...
It is not necessary, but it sure makes the job easier. For example, if you did not use a def statement to define the absolute value function, you would have to type the whole thing every time you want two numbers compared by their absolute value. It is not about space saving, but about time saving...
Fred is offline   Reply With Quote