Ad
  • Default User Avatar
  • Custom User Avatar

    What error? Could you please tell me (posting under my comment below, so that I can be notified at once) the test arrays and the test array and the error message?

    I tried the whole code also in another environment and seems to work fine, so I need more info (right under JMurphy's reply to my comment is ok) to fix it.

    Thanks :)

  • Custom User Avatar

    Quote from description:

    Remember that the resulting composed function may be passed multiple arguments!

    ...but I guess you figured it out already.

  • Custom User Avatar

    Actually, only one is given in one of the test cases when calling Plugboard() without any arguments for testing empty construction. Honestly, I think it should be Plugboard('') for empty pairing.

  • Custom User Avatar

    Yes, that's the idea.

    In this exercise, you are required to understand exception and how to raise an error whenever an input is outside definition.

    • if you have to many wires, you should raise an exception (anything is fine, but it will be better if you raise ValueError)

    • __init__ takes 2 arguments. One is self which is mandatory, and second, wires which is defaulted to no wire pairings when not defined. I'd suggest google for Python default parameter to understand more.