FAQ
Thought this group would appreciate this: www.metabright.com/challenges/python


MetaBright makes skill assessments to measure how talented people are at different skills. And recruiters use MetaBright to find outrageously skilled job candidates.


Python is a new area of expertise for us. We make "Challenges" for a bunch of languages and we're excited to finally have Python released. Give it a shot -- I'd love to hear what you think.

Search Discussions

  • Andrew Cooper at Nov 7, 2013 at 12:13 am

    On 07/11/2013 00:00, Nathaniel Sokoll-Ward wrote:
    Thought this group would appreciate this: www.metabright.com/challenges/python

    MetaBright makes skill assessments to measure how talented people are at different skills. And recruiters use MetaBright to find outrageously skilled job candidates.

    Python is a new area of expertise for us. We make "Challenges" for a bunch of languages and we're excited to finally have Python released. Give it a shot -- I'd love to hear what you think.

    "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.


    "String literals are written with what?"


    The answer is not "ALl of these answers are correct"




    So two of of 7 questions with wrong answers so far...


    ~Andrew
  • Roy Smith at Nov 7, 2013 at 12:24 am
    In article <jWAeu.102858$rN3.45213 at fx21.am4>,
      Andrew Cooper wrote:

    On 07/11/2013 00:00, Nathaniel Sokoll-Ward wrote:
    Thought this group would appreciate this:
    www.metabright.com/challenges/python

    MetaBright makes skill assessments to measure how talented people are at
    different skills. And recruiters use MetaBright to find outrageously
    skilled job candidates.

    Python is a new area of expertise for us. We make "Challenges" for a bunch
    of languages and we're excited to finally have Python released. Give it a
    shot -- I'd love to hear what you think.
    "What is the correct number of spaces for indentation in Python?"







    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.
  • Andrew Cooper at Nov 7, 2013 at 12:28 am

    On 07/11/2013 00:24, Roy Smith wrote:
    In article <jWAeu.102858$rN3.45213 at fx21.am4>,
    Andrew Cooper wrote:
    On 07/11/2013 00:00, Nathaniel Sokoll-Ward wrote:
    Thought this group would appreciate this:
    www.metabright.com/challenges/python

    MetaBright makes skill assessments to measure how talented people are at
    different skills. And recruiters use MetaBright to find outrageously
    skilled job candidates.

    Python is a new area of expertise for us. We make "Challenges" for a bunch
    of languages and we're excited to finally have Python released. Give it a
    shot -- I'd love to hear what you think.
    "What is the correct number of spaces for indentation in Python?"



    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.

    "Which is a correct way to perform exponentiation in Python?"


    1) math.pow(a,b)
    2) a^b
    3) a*2b
    4) None of the other responses are correct


    Apparently I was wrong by answering 4), and 1) is the expected answer.
    Clearly the author doesn't know about the ** operator in python.




    It appears that no serious python coders were consulted when writing
    these questions.


    ~Andrew
  • Mark Lawrence at Nov 7, 2013 at 12:38 am

    On 07/11/2013 00:28, Andrew Cooper wrote:
    On 07/11/2013 00:24, Roy Smith wrote:
    In article <jWAeu.102858$rN3.45213 at fx21.am4>,
    Andrew Cooper wrote:
    On 07/11/2013 00:00, Nathaniel Sokoll-Ward wrote:
    Thought this group would appreciate this:
    www.metabright.com/challenges/python

    MetaBright makes skill assessments to measure how talented people are at
    different skills. And recruiters use MetaBright to find outrageously
    skilled job candidates.

    Python is a new area of expertise for us. We make "Challenges" for a bunch
    of languages and we're excited to finally have Python released. Give it a
    shot -- I'd love to hear what you think.
    "What is the correct number of spaces for indentation in Python?"



    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.
    "Which is a correct way to perform exponentiation in Python?"

    1) math.pow(a,b)
    2) a^b
    3) a*2b
    4) None of the other responses are correct

    Apparently I was wrong by answering 4), and 1) is the expected answer.
    Clearly the author doesn't know about the ** operator in python.


    It appears that no serious python coders were consulted when writing
    these questions.

    ~Andrew

    So that narrows the search for the culprit down to our Greek aquaintance? :)


    --
    Python is the second best programming language in the world.
    But the best has yet to be invented. Christian Tismer


    Mark Lawrence
  • Chris Angelico at Nov 7, 2013 at 12:59 am

    On Thu, Nov 7, 2013 at 11:00 AM, Nathaniel Sokoll-Ward wrote:
    Thought this group would appreciate this: www.metabright.com/challenges/python

    MetaBright makes skill assessments to measure how talented people are at different skills. And recruiters use MetaBright to find outrageously skilled job candidates.

    Python is a new area of expertise for us. We make "Challenges" for a bunch of languages and we're excited to finally have Python released. Give it a shot -- I'd love to hear what you think.

    """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.)


    """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..."?


    """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.


    ChrisA
  • MRAB at Nov 7, 2013 at 1:12 am

    On 07/11/2013 00:59, Chris Angelico wrote:
    On Thu, Nov 7, 2013 at 11:00 AM, Nathaniel Sokoll-Ward
    wrote:
    Thought this group would appreciate this: www.metabright.com/challenges/python

    MetaBright makes skill assessments to measure how talented people are at different skills. And recruiters use MetaBright to find outrageously skilled job candidates.

    Python is a new area of expertise for us. We make "Challenges" for a bunch of languages and we're excited to finally have Python released. Give it a shot -- I'd love to hear what you think.
    """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.)

    """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..."?

    """From which languages are Python classes derived from?"""
    Does it really have the word "from" twice?

    Sounds like Python history trivia more than a coding challenge, but if
    that's what you want to go for, sure.
  • Chris Angelico at Nov 7, 2013 at 1:17 am

    On Thu, Nov 7, 2013 at 12:12 PM, MRAB wrote:
    """From which languages are Python classes derived from?"""
    Does it really have the word "from" twice?

    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.


    ChrisA
  • Chris Angelico at Nov 7, 2013 at 1:04 am

    On Thu, Nov 7, 2013 at 11:00 AM, Nathaniel Sokoll-Ward wrote:
    Thought this group would appreciate this: www.metabright.com/challenges/python

    MetaBright makes skill assessments to measure how talented people are at different skills. And recruiters use MetaBright to find outrageously skilled job candidates.

    Python is a new area of expertise for us. We make "Challenges" for a bunch of languages and we're excited to finally have Python released. Give it a shot -- I'd love to hear what you think.

    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.


    ChrisA
  • John Nagle at Nov 7, 2013 at 1:31 am

    On 11/6/2013 5:04 PM, Chris Angelico wrote:
    On Thu, Nov 7, 2013 at 11:00 AM, Nathaniel Sokoll-Ward
    wrote:
    Thought this group would appreciate this: www.metabright.com/challenges/python

    MetaBright makes skill assessments to measure how talented people are at different skills. And recruiters use MetaBright to find outrageously skilled job candidates.

        With tracking cookies blocked, you get 0 points.


         John Nagle
  • Tim Chase at Nov 7, 2013 at 3:19 am

    On 2013-11-06 17:31, John Nagle wrote:
    MetaBright makes skill assessments to measure how talented
    people are at different skills. And recruiters use MetaBright to
    find outrageously skilled job candidates.
    With tracking cookies blocked, you get 0 points.

    And with JavaScript blocked, you get bupkis. :-)


    I was amused that the sidebar of similar challenges suggested that
    the Python challenge might be similar to this one. Ya think? So
    similar that even the URL is the same...


    -tkc
  • Nathaniel Sokoll-Ward at Nov 7, 2013 at 6:38 pm
    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!
  • Mark Lawrence at Nov 7, 2013 at 6:48 pm

    On 07/11/2013 18:38, Nathaniel Sokoll-Ward wrote:

    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?
    def a(b, c, d): pass
    ...
    x=a(1,2,3);type(x)
    <class 'NoneType'>


    --
    Python is the second best programming language in the world.
    But the best has yet to be invented. Christian Tismer


    Mark Lawrence
  • Alister at Nov 7, 2013 at 7:08 pm

    On Thu, 07 Nov 2013 10:38:40 -0800, Nathaniel Sokoll-Ward wrote:


    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...

    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?

    your sites answer is " defines a function that does nothing"
    once you have defined the function try print (a(1,2,3))
    you will see that is does indeed return none, as do all functions without
    an explicit return.
    >

    Thanks again everyone!
    --
    While you recently had your problems on the run, they've regrouped and
    are making another attack.
  • Roy Smith at Nov 8, 2013 at 1:02 am
    In article <pyReu.25286$ql7.11998 at fx33.am4>,
      Alister wrote:

    your sites answer is " defines a function that does nothing"
    once you have defined the function try print (a(1,2,3))
    you will see that is does indeed return none, as do all functions without
    an explicit return.

    Well, if you want to be truly pedantic about it (*), this defines a
    function without an explicit return and which does not return None:


    def foo():
        raise Exception


    and, for that matter:


    def bar():
        import os
        os._exit(0) # Or variations, such as exec()


    (*) and I do.
  • Alex23 at Nov 8, 2013 at 1:49 am

    On 8/11/2013 11:02 AM, Roy Smith wrote:
    Well, if you want to be truly pedantic about it (*), this defines a
    function without an explicit return and which does not return None:

    def foo():
    raise Exception



    In [2]: import dis
    In [3]: dis.dis(foo)
        2 0 LOAD_GLOBAL 0 (Exception)
                    3 RAISE_VARARGS 1
                    6 LOAD_CONST 0 (None)
                    9 RETURN_VALUE


    Seeing as we're being pedantic, the function *does* return None, it's
    just that the return value is never seen because an exception is raise.
  • Roy Smith at Nov 8, 2013 at 1:54 am

    In article <l5hfuj$m2n$1 at dont-email.me>, alex23 wrote:

    On 8/11/2013 11:02 AM, Roy Smith wrote:
    Well, if you want to be truly pedantic about it (*), this defines a
    function without an explicit return and which does not return None:

    def foo():
    raise Exception

    In [2]: import dis
    In [3]: dis.dis(foo)
    2 0 LOAD_GLOBAL 0 (Exception)
    3 RAISE_VARARGS 1
    6 LOAD_CONST 0 (None)
    9 RETURN_VALUE

    Seeing as we're being pedantic, the function *does* return None, it's
    just that the return value is never seen because an exception is raise.

    Dead code doesn't count.
  • Alex23 at Nov 8, 2013 at 2:08 am

    On 8/11/2013 11:54 AM, Roy Smith wrote:
    Dead code doesn't count.

    Neither do shifting goalposts.
  • Roy Smith at Nov 8, 2013 at 2:18 am

    In article <l5hh32$qf4$1 at dont-email.me>, alex23 wrote:

    On 8/11/2013 11:54 AM, Roy Smith wrote:
    Dead code doesn't count.
    Neither do shifting goalposts.

    It's not a shifting goalpost. My original statement was that:


    def foo():
        raise Exception


    defines a function which 1) has no explicit return statement and 2) does
    not return None. I stand by that statement. There is no possible
    codepath, no possible calling sequence, no possible execution
    environment, which will cause that function to return None. That fact
    that one particular Python implementation happens to produce unreachable
    bytecode for returning None is meaningless. Would you say that:


    def baz():
        return None
        print "I got here"


    is a function which prints "I got here"?
  • Chris Angelico at Nov 8, 2013 at 2:26 am

    On Fri, Nov 8, 2013 at 1:18 PM, Roy Smith wrote:
    It's not a shifting goalpost. My original statement was that:

    def foo():
    raise Exception

    defines a function which 1) has no explicit return statement and 2) does
    not return None. I stand by that statement. There is no possible
    codepath, no possible calling sequence, no possible execution
    environment, which will cause that function to return None. That fact
    that one particular Python implementation happens to produce unreachable
    bytecode for returning None is meaningless. Would you say that:

    def baz():
    return None
    print "I got here"

    is a function which prints "I got here"?

    Granted, but I would describe this:


    def foo(x):
         return "Hello, world!\n" + str(x)


    as a function which returns a string. Is it? Well, not if str raises
    an exception. Even if the only arguments you can give to foo will
    result in exceptions, I would still say that, per design, this is a
    function that returns a string. The possibility of raising an
    exception (and thus not returning anything) doesn't change a
    function's return type (by which I mean more than just what C would
    use as the declaration - I could just as well say "Returns the name of
    an employee", and the same argument would apply).


    ChrisA
  • Tim Chase at Nov 8, 2013 at 4:05 am

    On 2013-11-07 21:18, Roy Smith wrote:
    It's not a shifting goalpost. My original statement was that:

    def foo():
    raise Exception

    defines a function which 1) has no explicit return statement and 2)
    does not return None. I stand by that statement. There is no
    possible codepath, no possible calling sequence, no possible
    execution environment, which will cause that function to return
    None.

    Well, for varying definitions of "that function", you can do

    def unerr(fn):
    ... def wrapper(*args, **kwargs):
    ... try:
    ... fn(*args, **kwargs)
    ... except:
    ... return None
    ... return wrapper
    ...
    @unerr
    ... def foo():
    ... raise Exception
    ...
    print foo()
    None


    ;-)


    Beyond that, I'm sure one could resort to bytecode hacking to have
    "that function" skip the raise...


    -tkc
  • Steven D'Aprano at Nov 8, 2013 at 5:26 am

    On Thu, 07 Nov 2013 22:05:14 -0600, Tim Chase wrote:

    On 2013-11-07 21:18, Roy Smith wrote:
    It's not a shifting goalpost. My original statement was that:

    def foo():
    raise Exception

    defines a function which 1) has no explicit return statement and 2)
    does not return None. I stand by that statement. There is no possible
    codepath, no possible calling sequence, no possible execution
    environment, which will cause that function to return None.
    Well, for varying definitions of "that function", you can do
    [snip modified functions]
    Beyond that, I'm sure one could resort to bytecode hacking to have "that
    function" skip the raise...

    Now who's shifting the goalposts? Whether you edit the function's source
    code, wrap it in a decorator, or hack it's byte-code, it's not the same
    function as the one Roy showed above by any reasonable definition of "the
    same". As an intellectual exercise of how one might subvert the standard
    semantics of the Python compiler, it is interesting to consider (say)
    byte-code hacks that turn this source code:


    def foo():
         raise Exception


    into something that returns None, but by the same logic one might say
    that this function:


    def spam():
         return 42


    connects to some database over the Internet and deletes any table
    containing more than seven records. If we're going to allow those sorts
    of debating shenanigans, the obvious counter is "yes, but when I said
    that the function doesn't return None, I actually meant that it doesn't
    solve the Halting Problem, and it still doesn't do that, so I win nyah
    nyah nyah".






    --
    Steven
  • Mark Lawrence at Nov 8, 2013 at 9:23 am

    On 08/11/2013 02:18, Roy Smith wrote:
    In article <l5hh32$qf4$1 at dont-email.me>, alex23 wrote:
    On 8/11/2013 11:54 AM, Roy Smith wrote:
    Dead code doesn't count.
    Neither do shifting goalposts.
    It's not a shifting goalpost. My original statement was that:

    def foo():
    raise Exception

    defines a function which 1) has no explicit return statement and 2) does
    not return None. I stand by that statement. There is no possible
    codepath, no possible calling sequence, no possible execution
    environment, which will cause that function to return None. That fact
    that one particular Python implementation happens to produce unreachable
    bytecode for returning None is meaningless. Would you say that:

    def baz():
    return None
    print "I got here"

    is a function which prints "I got here"?

    Game, set and match to Roy Smith? :)


    --
    Python is the second best programming language in the world.
    But the best has yet to be invented. Christian Tismer


    Mark Lawrence
  • Gregory Ewing at Nov 8, 2013 at 6:47 am

    alex23 wrote:
    In [2]: import dis
    In [3]: dis.dis(foo)
    2 0 LOAD_GLOBAL 0 (Exception)
    3 RAISE_VARARGS 1
    6 LOAD_CONST 0 (None)
    9 RETURN_VALUE

    Seeing as we're being pedantic, the function *does* return None, it's
    just that the return value is never seen because an exception is raise.

    Koan for the day:


    If a man goes into the forest and never returns,
    does he bring back nothing?


    --
    Greg
  • Chris Angelico at Nov 7, 2013 at 10:55 pm

    On Fri, Nov 8, 2013 at 5:38 AM, Nathaniel Sokoll-Ward wrote:
    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...

    Best way, I think :)

    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

    Hmm. As a general rule, can you consider aiming your quiz - and any
    citations like this - at a current version of Python? I'd prefer to
    see this sort of thing aimed at the 3.3 docs, though if you want to
    cite 2.7 that would also be of value. But 2.5 is now quite old, and
    I'd rather not get the impression that you're writing a quiz based on
    an unsupported version of Python. :) Though in this particular
    instance it makes no difference.

    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!

    Heh. Do you know what the limitation of my solution is, though? As I
    said, it works for the given test-cases; what sort of input will it
    fail on? (And also: What's its algorithmic complexity, and what's the
    complexity of a better solution?) That's why I said it's a bad
    solution :)


    The side comment about arrays, though: Python *does* have arrays, but
    they're a different beast from what you're working with, which are
    called lists. The version I posted will actually work with any
    iterable, but specifying that it be a list might open up some other
    options.


    BTW, you're going to see a lot of criticism on the list, because
    that's the natural state of things. Doesn't mean we didn't enjoy
    taking the quiz. :)


    In your Intermediate section:
    """Which of the following is false regarding the raw_input() and
    input() built-in functions in Python?


    The old raw_input() has been renamed to input() in Python 3.x
    input() is equivalent to exec(raw_input())
    In Python 2.x, raw_input() returns a string.
    raw_input() does not exist in Python 3.x"""


    Technically one of those is false, but (a) you really need to specify
    versions a LOT more clearly here, and (b) the falseness is a minor
    technicality; it took me a while to notice that you'd written exec
    where it actually uses eval. Is that distinction really worth
    highlighting in the quiz?


    """Which of the following statements is false?


    Python can be used to generate dynamic web pages.
    Python can be used for web development.
    Python's syntax is much like PHP.
    Python can run on any type of platform."""


    What does *any type* of platform mean? Do you mean "any platform", and
    if so, do you mean that there is no pocket calculator on which Python
    doesn't run? Or is there some other "type" of platform?

    type(platform)
    <class 'module'>


    I get it. Python will run on any module. *dives for cover*


    BTW, here's my chosen "bad solution" for the boss question at the end
    of the intermediate section. I'm sure someone here can come up with a
    worse one. Wasn't sure what should be done if all three numbers are
    the same, incidentally.


    def indie_three(*numbers):
         seen = {}
         tot = 0
         for n in numbers:
             seen.setdefault(n, 5)
             seen[n] -= 4
             tot += n * seen[n]
         return tot


    Note how I've generalized it to any number of input values AND to any
    possible number of duplicates!


    ChrisA
  • Jskirst at Nov 7, 2013 at 7:02 pm
    We do not currently support cookieless or javascript-less browsing. We are definitely looking at relying less and less on cookies, but it's unlikely we'll ever be able to pull out javascript as it limits interactivity too much. Its definitely possible to do, and maybe something we can look at in the future, but right now we don't have the resources for that. Sorry for the inconvenience!


    - Jonathan Kirst
    Lead Engineer at MetaBright

    On Wednesday, November 6, 2013 7:19:23 PM UTC-8, Tim Chase wrote:
    On 2013-11-06 17:31, John Nagle wrote:

    MetaBright makes skill assessments to measure how talented
    people are at different skills. And recruiters use MetaBright to
    find outrageously skilled job candidates.

    With tracking cookies blocked, you get 0 points.


    And with JavaScript blocked, you get bupkis. :-)



    I was amused that the sidebar of similar challenges suggested that

    the Python challenge might be similar to this one. Ya think? So

    similar that even the URL is the same...



    -tkc
  • Tim Chase at Nov 7, 2013 at 7:30 pm

    On 2013-11-07 11:02, jskirst at gmail.com wrote:
    it's unlikely we'll ever be able to pull out javascript as it
    limits interactivity too much.

    It was mostly in jest as it's one of the things I test when doing
    web development. That said, the quizzes are mostly just HTML forms
    where you pick the answer with a radio button and click the [next]
    button. There's not much interactivity there that hasn't been around
    since the dawn of the web.


    Additionally, I noticed that if I accidentally select an answer
    (laptop track-pads aren't the most precise pointing devices), there
    was no readily-apparent way to change/fix it before hitting [next].


    -tkc
  • 88888 Dihedral at Nov 8, 2013 at 12:19 am

    On Friday, November 8, 2013 3:02:10 AM UTC+8, jsk... at gmail.com wrote:
    We do not currently support cookieless or javascript-less browsing. We are definitely looking at relying less and less on cookies, but it's unlikely we'll ever be able to pull out javascript as it limits interactivity too much. Its definitely possible to do, and maybe something we can look at in the future, but right now we don't have the resources for that. Sorry for the inconvenience!



    - Jonathan Kirst

    Lead Engineer at MetaBright


    On Wednesday, November 6, 2013 7:19:23 PM UTC-8, Tim Chase wrote:

    On 2013-11-06 17:31, John Nagle wrote:

    MetaBright makes skill assessments to measure how talented
    people are at different skills. And recruiters use MetaBright to
    find outrageously skilled job candidates.

    With tracking cookies blocked, you get 0 points.



    And with JavaScript blocked, you get bupkis. :-)



    I was amused that the sidebar of similar challenges suggested that

    the Python challenge might be similar to this one. Ya think? So

    similar that even the URL is the same...



    -tkc

    That is easy. Please use FireFox
    plus NoScript to achieve what you
    want.
  • John Ladasky at Nov 7, 2013 at 1:55 am

    On Wednesday, November 6, 2013 4:00:57 PM UTC-8, Nathaniel Sokoll-Ward wrote:
    Thought this group would appreciate this: www.metabright.com/challenges/python

    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.
  • Chris Angelico at Nov 7, 2013 at 2:07 am

    On Thu, Nov 7, 2013 at 12:55 PM, John Ladasky wrote:
    On Wednesday, November 6, 2013 4:00:57 PM UTC-8, Nathaniel Sokoll-Ward wrote:
    Thought this group would appreciate this: www.metabright.com/challenges/python
    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.

    No need to hire anyone, just posting the questions here will generate
    exactly such a critique - as evidenced by this thread :)


    ChrisA
  • Omar Abou Mrad at Nov 8, 2013 at 7:09 am

    On Thu, Nov 7, 2013 at 2:00 AM, Nathaniel Sokoll-Ward wrote:


    Thought this group would appreciate this:
    www.metabright.com/challenges/python

    MetaBright makes skill assessments to measure how talented people are at
    different skills. And recruiters use MetaBright to find outrageously
    skilled job candidates.

    Python is a new area of expertise for us. We make "Challenges" for a bunch
    of languages and we're excited to finally have Python released. Give it a
    shot -- I'd love to hear what you think.
    --
    https://mail.python.org/mailman/listinfo/python-list



    Nathaniel,


    You may want to classify the questions under some weight. You can't really
    have a level 6 question about semi colon.


    Also, when the boss questions are being computed, you should run more than
    the 'example' given as a test, otherwise users can just cheat. For example,
    I think one of the 'Boss' question was return the first 3 digits of PI as a
    list, all i did was:


    return [3,1,4]


    Hope this helps.
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: <http://mail.python.org/pipermail/python-list/attachments/20131108/69eb0100/attachment-0001.html>
  • Nathaniel Sokoll-Ward at Nov 12, 2013 at 5:20 pm
    Hi Omar,


    Thanks for the suggestions!


    Your point about question difficulty is well taken. We previously organized
    questions into sections based on difficulty or topic, but have been
    experimenting with doing away with sections entirely. We are developing a
    way to intelligently deliver questions to a user based on their perceived
    skill level.


    You're right that our checks can be defeated with sneakiness, but in the
    end we believe that it makes more sense to implement incentives to
    encourage people to post high quality answers, than to build full-proof
    validation tools.


    Thanks again!




    On Thu, Nov 7, 2013 at 11:09 PM, Omar Abou Mrad wrote:

    On Thu, Nov 7, 2013 at 2:00 AM, Nathaniel Sokoll-Ward <
    nathanielsokollward at gmail.com> wrote:
    Thought this group would appreciate this:
    www.metabright.com/challenges/python

    MetaBright makes skill assessments to measure how talented people are at
    different skills. And recruiters use MetaBright to find outrageously
    skilled job candidates.

    Python is a new area of expertise for us. We make "Challenges" for a
    bunch of languages and we're excited to finally have Python released. Give
    it a shot -- I'd love to hear what you think.
    --
    https://mail.python.org/mailman/listinfo/python-list

    Nathaniel,

    You may want to classify the questions under some weight. You can't really
    have a level 6 question about semi colon.

    Also, when the boss questions are being computed, you should run more than
    the 'example' given as a test, otherwise users can just cheat. For example,
    I think one of the 'Boss' question was return the first 3 digits of PI as a
    list, all i did was:

    return [3,1,4]

    Hope this helps.
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: <http://mail.python.org/pipermail/python-list/attachments/20131112/6a79df5b/attachment.html>

Related Discussions

People

Translate

site design / logo © 2022 Grokbase