Lesson 12: On Beyond Strings


#1

In this lesson what is the purpose of having "return" functions? I tried taking them out and they essentially do the same thing. Can anyone explain?

def biggest_number(*args):
print max(args)
return max(args)

def smallest_number(*args):
print min(args)
return min(args)

def distance_from_zero(arg):
print abs(arg)
return abs(arg)

biggest_number(-10, -5, 5, 10)
smallest_number(-10, -5, 5, 10)
distance_from_zero(-10)

`


#2

It's because of you always have to return the variables when you do mathematical stuff.


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.