Issue
I find this mildly irritating as I am unable to see the reason.
The return statement (within a function) in VS Code (+ bash terminal) doesn't return any value, unless I explicit say print(function())
, like given in the code below.
This doesn't happen in Spyder, it promptly returns the value in the console.
Why is this so? What am I missing?
Solution
The main reason is that in Spyder you use IPython console. It is an interactive shell which provides extra features. Since in your bash terminal the Python console is used instead of IPython, it does not return the value of the function when it is prompted.
In this question, the differences between IPython and Python consoles are discussed.
Answered By - Global
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.