0
When i use print and return ?
Print vs return
2 Answers
+ 7
print function is used to print something on console
return is used to return something back to the function so that we can use that returned value to print or to pass on another function to use it.
For example:
def getSum():
a = 4
b = 6
return a + b
total = getSum()
print (total)