This is a terrible article. Some of the questions are good, but most of them are vague, and most of the answers don't use the right conventions. I won't talk about naming conventions, but take a look at the second question, os.walk would've been a much better alternative.
Thats what I thought as I was reading it as well. Really disappointed with codementor, I hope they hire someone to fix issues like this happening, because it seems to be a regular occurrence.
Many people teach out of a conviction to help people learn better. So, what you say isn't necessarily true, but I think this article is here simply for the sake of getting SEO hits since Python is a big search item these days for prospective programmers.
Do people actually memorize the code for walking through a directory in python? I have only had to use this once; there's no way I'd remember how to do it off the top of my head. And I don't think that knowledge of something that would take 2 minutes to google is that important.
That is exactly what I thought. If someone asks me to walk a directory in python I'm going to google. There is zero chance I could complete that question without access to the python docs.
Question 1 is pretty wrong since I believe 2.7... it compiles to pyc bytecode as everyone who has written python has seen. It is interpreted, but it still compiles.
And as for "what is python" That's not a great answer. Python is a programming language/grammar/spec, and if someone came out with a compiler that compiled python code to machine instructions then that's valid. Python is just a language.
I agree. This is what I meant, when I said that it was vague. But if we wanted to get down to the brass tacks, then python is a language, not an implementation per se. The answer to the first question does not even talk about the difference between the two.
So many companies these days are trying to "growth hack", but lose credibility in the process.
I found the comment I was going to make. Interviewers are going to ask you what you have done in Python and how long you've used it. MAYBE they'll ask about your problem solving thought process (I've had that question before). No one has ever asked me to tell them how to parse through directories or to look at trivial code to tell them the output.
my thoughts exactly. writing your own recursive function to do that is a neat trick, I guess, but Python has a very nice "batteries included" standard library that has already solved that problem. I'd expect an experienced python programmer to prefer to use that rather than roll their own.
109
u/gamesbrainiac Nov 20 '15 edited Nov 20 '15
This is a terrible article. Some of the questions are good, but most of them are vague, and most of the answers don't use the right conventions. I won't talk about naming conventions, but take a look at the second question,
os.walkwould've been a much better alternative.