Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #58687
| Newsgroups | comp.lang.python |
|---|---|
| Date | 2013-11-07 10:38 -0800 |
| References | <82328ec8-7178-4a17-abfe-13d444fab9cf@googlegroups.com> <mailman.2107.1383786254.18130.python-list@python.org> <l5eqi0$3ha$1@dont-email.me> <mailman.2114.1383794270.18130.python-list@python.org> |
| Message-ID | <c6a4b69c-51ee-4367-8bf0-aefed08d7bb1@googlegroups.com> (permalink) |
| Subject | Re: Show off your Python chops and compete with others |
| From | Nathaniel Sokoll-Ward <nathanielsokollward@gmail.com> |
Wow! Thanks for all the feedback everyone. This content is fresh so I appreciate everyone's comments. As opposed to responding to each post individually, I'll just lump everything in here...
Andrew, big thanks for your comments:
> "What is the correct number of spaces for indentation in Python?"
>
> I presume the question should be more along the lines of "What does PEP8
> say?", because all answers are correct.
I agree. Question has been edited.
>
> "String literals are written with what?"
>
> The answer is not "ALl of these answers are correct"
I believe that string literals can be written with single, double, or triple quotes: http://docs.python.org/release/2.5.2/ref/strings.html
> "Which is a correct way to perform exponentiation in Python?"
This was a silly error. Thanks for pointing it out.
> What does the following code do?
> def a(b, c, d): pass
>
> My answer: "Defines a function which returns None", but that isn't one
> of the choices.
Roy, thanks for your note. When I run this code, the function just gets defined and nothing happens. None isn't returned. Do you recall why you found the options available to you unsuitable?
> """How could you open a file c:\scores.dat to write in binary?
>
> outfile = open("c:\\scores.dat", "w")
> outfile = open("c:\scores.dat", "a")
> outfile = open("c:\\scores.dat", "w")
> outfile = open("c:\\scores.dat", "wb")"""
>
> Not technically wrong, but stylistically suspect; I would recommend
> using forward slashes (which work fine on Windows) and avoiding the
> drive letter, both of which avoid making your example
> Windows-specific. (At least, I don't think there are any other
> platforms Python supports that use drive letters; OS/2 support was
> dropped a little while ago, though I believe Paul Smedley still
> maintains a port. But I digress.)
Excellent suggestion. We've gone ahead and made the change.
>
> """Which method will write a pickled representation of the object to
> an open file?"""
>
> Method names without object names aren't all that useful. Do you mean
> "Which method of the pickle module..."?
Again, great suggestion.
>
> """From which languages are Python classes derived from?"""
>
> Sounds like Python history trivia more than a coding challenge, but if
> that's what you want to go for, sure.
I agree it's not directly coding related. Our questions are actually sorted into topic buckets. We try to get a reading on people's knowledge in a bunch of different areas of a given skill. Familiarity with general knowledge facts such as this, gives us another data point to help parse out the types of questions the best developers tend to get right.
> By the way, here's a fairly bad solution to your final question:
>
> array666=lambda x:b"\6\6\6" in bytes(x)
>
> Works for the given test-cases! Doesn't work with arrays at all,
> despite the description.
Chris, I actually really like your answer, even if it doesn't satisfy the goal in the question. I'd give it a vote for cleverness!
> You know, I didn't even notice that. But since that was copied and
> pasted, I would say that yes, it really does. That's a pretty simple
> grammatical bugfix though.
Silly error. Fixed.
> I have to concur with what several other people are saying here. Several of MetaBright's questions are > ambiguously worded, or expect non-idiomatic Python code. It might be helpful for you to ask (hire?) > some seasoned Python programmers to critique your questions.
Thanks for the thoughts, John. I'd be lying if I said I wasn't disappointed with how many errors everyone here is picking out. Some of our Challenges are built exclusively by our users, others are built by someone who helped build MetaBright, while others, like the Python Challenge, are built with the help of contractors. Even so, the responsibility to make sure we are publishing high quality content falls on our shoulders and I regret we didn't go a better job of vetting this material.
> With tracking cookies blocked, you get 0 points.
> And with JavaScript blocked, you get bupkis. :-)
I know that's frustrating. Our tech lead will be on here later today to explain why we do this.
Thanks again everyone!
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Show off your Python chops and compete with others Nathaniel Sokoll-Ward <nathanielsokollward@gmail.com> - 2013-11-06 16:00 -0800
Re: Show off your Python chops and compete with others Andrew Cooper <root@127.0.0.1> - 2013-11-07 00:13 +0000
Re: Show off your Python chops and compete with others Roy Smith <roy@panix.com> - 2013-11-06 19:24 -0500
Re: Show off your Python chops and compete with others Andrew Cooper <root@127.0.0.1> - 2013-11-07 00:28 +0000
Re: Show off your Python chops and compete with others Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-07 00:38 +0000
Re: Show off your Python chops and compete with others Chris Angelico <rosuav@gmail.com> - 2013-11-07 11:59 +1100
Re: Show off your Python chops and compete with others Chris Angelico <rosuav@gmail.com> - 2013-11-07 12:04 +1100
Re: Show off your Python chops and compete with others John Nagle <nagle@animats.com> - 2013-11-06 17:31 -0800
Re: Show off your Python chops and compete with others Tim Chase <python.list@tim.thechases.com> - 2013-11-06 21:19 -0600
Re: Show off your Python chops and compete with others Nathaniel Sokoll-Ward <nathanielsokollward@gmail.com> - 2013-11-07 10:38 -0800
Re: Show off your Python chops and compete with others Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-07 18:48 +0000
Re: Show off your Python chops and compete with others Alister <alister.ware@ntlworld.com> - 2013-11-07 19:08 +0000
Re: Show off your Python chops and compete with others Roy Smith <roy@panix.com> - 2013-11-07 20:02 -0500
Re: Show off your Python chops and compete with others alex23 <wuwei23@gmail.com> - 2013-11-08 11:49 +1000
Re: Show off your Python chops and compete with others Roy Smith <roy@panix.com> - 2013-11-07 20:54 -0500
Re: Show off your Python chops and compete with others alex23 <wuwei23@gmail.com> - 2013-11-08 12:08 +1000
Re: Show off your Python chops and compete with others Roy Smith <roy@panix.com> - 2013-11-07 21:18 -0500
Re: Show off your Python chops and compete with others Chris Angelico <rosuav@gmail.com> - 2013-11-08 13:26 +1100
Re: Show off your Python chops and compete with others Tim Chase <python.list@tim.thechases.com> - 2013-11-07 22:05 -0600
Re: Show off your Python chops and compete with others Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-11-08 05:26 +0000
Re: Show off your Python chops and compete with others Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-08 09:23 +0000
Re: Show off your Python chops and compete with others Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2013-11-08 19:47 +1300
Re: Show off your Python chops and compete with others Chris Angelico <rosuav@gmail.com> - 2013-11-08 09:55 +1100
Re: Show off your Python chops and compete with others jskirst@gmail.com - 2013-11-07 11:02 -0800
Re: Show off your Python chops and compete with others Tim Chase <python.list@tim.thechases.com> - 2013-11-07 13:30 -0600
Re: Show off your Python chops and compete with others 88888 Dihedral <dihedral88888@gmail.com> - 2013-11-07 16:19 -0800
Re: Show off your Python chops and compete with others MRAB <python@mrabarnett.plus.com> - 2013-11-07 01:12 +0000
Re: Show off your Python chops and compete with others Chris Angelico <rosuav@gmail.com> - 2013-11-07 12:17 +1100
Re: Show off your Python chops and compete with others John Ladasky <john_ladasky@sbcglobal.net> - 2013-11-06 17:55 -0800
Re: Show off your Python chops and compete with others Chris Angelico <rosuav@gmail.com> - 2013-11-07 13:07 +1100
Re: Show off your Python chops and compete with others Omar Abou Mrad <omar.aboumrad@gmail.com> - 2013-11-08 09:09 +0200
Re: Show off your Python chops and compete with others Nathaniel Sokoll-Ward <nathanielsokollward@gmail.com> - 2013-11-12 09:20 -0800
csiph-web