[Python] Return Statement
Python function is just collection of python codes that perform specific tasks. So we just call python function when we want perform that tasks; However, sometimes when we call the function we're actually going to get the information back from that function.
"Return" keyword, which allows python to return the information from the function.
Let's make this function; you can actually make your own function with "def"
and run..
but we got "none"
We expected it would cube the numbers .. but NOT !
Now, Let's do this
Python is going to return whatever value we put inside. so when I call the cube function, and give it "3" python is going to execute the function and return the values.
we got the right number !
one more ! you can do like this too
Just for more information!
It's not able to put something after return statement;
so never reach to the code after return statement.