What is the difference between print and return? Thanks


Replace this line with your code.


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.