Return


#1

what is the difference between print and return..!
and what is the reason that we return the argument after we define the function?

i


#2

print is a function that puts output on screen (loosely speaking)
return is a keyword that acts as a exit door for a function ,and returns processed value from function,you can save this value and use it.

There is a good article to look at..

Difference between print and return


#3

thank you..

while defining a function , it is necessary to return the result . before proceeding..?
thank you


#4

No its not necessary ,But when we do not return anything function by default returns None.

None is a constant that represents absence of a value.

Though using return makes your function more powerful and it can be used in more flexible way.


#5

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