0
How is return different than print? other than syntax
2 ответов
+ 2
print only gives the user the output. Return makes it a value that the program understand. You would not be able to add numbers to the result of a function if it was a print function. The explanation is more clear here.
http://stackoverflow.com/questions/3881434/difference-between-returns-and-printing-in-JUMP_LINK__&&__python__&&__JUMP_LINK
- 2
Both do technically the same thing. The only difference being that you can return only one value per function with return whereas you can print anything any number of times with print. I would not recommend writing this answer in a test as this is only for your understanding. Hope this helped.😃