Ad
  • Default User Avatar
  • Default User Avatar

    I on python,my answer is working but I don't understand why a for loop I have runs twice the same thing with any other loop I try, it for some reason just keep running twice and because of that it gives me the wrong answer. also when I try to run test cases there aren't any.

  • Default User Avatar

    really interesting and a lot can be learned on this by beginners like me

  • Custom User Avatar

    See above for my reply and thanks for your kind warning :)

  • 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

    Hi. The comment above suggests there is a problem with the python test cases? Hopefully you can take a look - I have no idea about it im afraid! Cheers.

  • Default User Avatar

    When trying out test cases in python it gives an error even when the code works

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

  • Default User Avatar

    I keep getting this error "TypeError: () takes exactly 1 argument (5 given)" and I don't know what's wrong, it seems to work for the test cases and when I submit it worked and still gives this error and says 2 passed what am I doing wrong?

  • Default User Avatar

    I need some help, it keep's saying that I have too many wires defines but I made sure that I only have 10 wires, any help? Also sometimes it also says init takes 2 arguments and only one is given? What am I meant to do?

  • Default User Avatar

    I have the code working but it just won't accept it. It keeps saying 'set([1])' should equal set([1])' what do I do?