What questions do you think should a good Python programmer be able to respond to?
PS: I have seen this question based on other languages but not Python!
What questions do you think should a good Python programmer be able to respond to?
PS: I have seen this question based on other languages but not Python!
How can you use a mutable object as a default value to a function?
And the closely related...
What are possible consequences of doing this?
def append_to( b, c=[] ):
c.append( b )
Some fancier language features:
I'd say anyone with some experience has used one of these:
Why does this happen? Why isn't the answer -1?
>>> 3.1-4.1
-0.99999999999999956
'foo'?What is the difference between str and unicode, and which would you use in what circumstances?
This is the most often heard question (at least to me)
Why would I use python if I already know xxxx (insert any language here) ?
I know, not as impressive as the other answers....
Why should you refer to "names" and "binding" in Python instead of "variables" and "assignment"?
"hello " * n where n is a number.10 ** 2 do?I have a list of lists:
l=[[0]]*10
print(l)
# [[0], [0], [0], [0], [0], [0], [0], [0], [0], [0]]
Why is it that when I change one element, all the elements change:
l[0][0]=1
print(l)
# [[1], [1], [1], [1], [1], [1], [1], [1], [1], [1]]
What is going to print :
def paradox():
try:
raise Exception("Here")
except:
return "There"
finally:
return "Or maybe there"
return "Or it that here?"
print paradox()
I love this one, because even the best programmers idle before answering.
Why is mutability and immutability important? When ought you to care? (Note: The author of this question is still quite fuzzy on these.)
While much is "batteries included," what are the three most esoteric add-ons to Python you have used?
What is your general strategy for researching and performing Windows functions in Python?
Tell me about your favorite Python idiom. How did you discover it? How did you refine it?
What are some of the shortcomings in the development of Python and the surrounding ecosystem?