0

What is the difference of return and print in python

#print #return

28th Sep 2018, 9:43 AM
Michael Angelo G. Bongo
Michael Angelo G. Bongo - avatar
3 Answers
+ 2
- return: Its used ONLY inside functions and return some value to caller to the function (or return nothing though technically it return None value) - print: its a builtin function (in py3) that allow you to add text to your console example: def mul(a,b): return a*b # here result will be 40 result= mul(5,8) print(result) # Now 40 is printed to your console
28th Sep 2018, 9:51 AM
KrOW
KrOW - avatar
+ 1
thanks 😂
28th Sep 2018, 11:42 AM
Michael Angelo G. Bongo
Michael Angelo G. Bongo - avatar
0
👍👍👍
28th Sep 2018, 11:47 AM
KrOW
KrOW - avatar