Ad
  • Custom User Avatar

    Yea, that looks like it would work.

    I've done that before too trying to return random.shuffle([1, 2, 3]). Same idea, it modifies the list in-place but returns None. We all make mistakes, part of the learning process!

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Ah now I get where the problems comes from. So the test case is exactly what is happening, the funny guy is giving less cards than expected e.g. an empty array or...no array (~~default value)

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Thanks for noticing that. I updated all solutions (initial and complete) for all languages

  • Custom User Avatar

    Why do you expect a TypeError?

    exception TypeError
    Raised when an operation or function is applied to an object of inappropriate type. The associated value is a string giving details about the type mismatch.
    

    And python offers builtin array element loop. Don't try to write C++:

    for i in [4,8,7,9]
        print i
    

    Would print:

    4
    8
    7
    9
    
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution