(Oct-14-2019, 04:33 PM)PyNovice Wrote: I had included listCWD() in order to test the function in the listCWD.py Module but forgot to remove it.That is what line 32 would do - it will be executed when you run the module as a script, but not when you import
(Oct-14-2019, 04:33 PM)PyNovice Wrote: Should I include return at the end of the function after removing listCWD?It depends what you want it to do. Generally it would be considered better if the function has no side effects like printing. If you want a function to print the content of cwd then it's ok not to return anything (this will return implicitly None). On other hand you may return the content without printing it thus making the function more "universal" - e.g. in other cases you may want to use what it return instead of just printing it
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs