When i use print and return ? | Sololearn: Learn to code for FREE!

0

When i use print and return ?

Print vs return

8/7/2022 7:24:19 PM

Ismail Backach

2 Answers

New Answer

+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)

+3

https://code.sololearn.com/cpGThocHw9cA/?ref=app