Jul-01-2018, 09:33 AM
The
So, if you don't need any of the data produced in a function, you are not obligated to use it at at all - by default, functions return
You also don't have to use the returned value in the calling code - you may have a function that returns result, and sometimes this result is discarded.
return
statement does just that - returns selected the result of the processing within a function.So, if you don't need any of the data produced in a function, you are not obligated to use it at at all - by default, functions return
None
in PythonYou also don't have to use the returned value in the calling code - you may have a function that returns result, and sometimes this result is discarded.
Test everything in a Python shell (iPython, Azure Notebook, etc.)
- Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
- Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
- You posted a claim that something you did not test works? Be prepared to eat your hat.