What is the difference between print and return? Thanks


#1



Replace this line with your code.


#2

print is only a construct with no lasting value. If all our function does is print a result, it is not given back from the function. This is the purpose of return, to give a value back to the calling scope for further use. There is no actual (practical) comparison between the two.