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



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


thank you..

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


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.


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