0

What is the difference here between print and return

Using 'print' gives everything while using'return' only prints '5'..why? https://code.sololearn.com/c0SsebgwP0Hm/?ref=app

7th Jul 2019, 8:01 AM
Y AD Ù
Y AD Ù - avatar
2 Answers
+ 4
return ends a function call, so the rest of the loop is never executed.
7th Jul 2019, 8:03 AM
HonFu
HonFu - avatar
+ 4
return and print are different in every way, print is just like telling someone to repeat what you say while return is just like sending someone on an errand and having them deliver what you want to either you or who ever you want em to deliver it to
7th Jul 2019, 8:46 AM
✳AsterisK✳
✳AsterisK✳ - avatar