Assume we define a function and then end it with:
def function():
# ...
return result
# To see the result, we need to type:
print(function())
Another option is to end a function with a print:
def function():
# ...
print(result)
# no need of print at the call anymore so
function()
Question: May I end function with a return statement, get it via function() or not?
I mean I don't care whether function saves the result or not. However the function can have several different results, i.e I need to quit the loop at some point. The main idea is to get the output on the screen.
So, let me know please whether my variant is OK or it's not 'elegant' coding. Thanks!