I had already finished my first python course, and also have my own certificate
Somehow, I couldn't understand what actually return
in python would help me in coding
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (2)
Ah, return in Python is used for functions.
Normally when you pass a variable in a function like so:
With this you can make code cleaner and more easily re-usable.
Lets say you want to do a complex mathematical computation but you don't want to write it down multiple times, here a function can help.
This:
Would become this:
Notice that the outcome is still the same, but now when the mathematical equations changes you only have to change it once instead of 3 (or potentially more times).
Thanks so much;)))