Ad
  • Custom User Avatar

    Am unable to run tests. Even after resetting, I get this error:

    Traceback (most recent call last):
      File "main.py", line 1, in <module>
        from solution import *
      File "/home/codewarrior/solution.py", line 1, in <module>
        from setup import *
      File "/home/codewarrior/setup.py", line 2, in <module>
        import codewars_test as test
    ModuleNotFoundError: No module named 'codewars_test'
    
  • Custom User Avatar

    Yeah, to be clear I did submit a proper solution before this one (just realized whilst I can still see it I'm sure if others can?)

    As ideally invalid solutions would be caught by tests (but that is hard to do) I find it an interesting challenge to try and sidestep them once I've completed the challenge properly.

  • 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

    I'm not really sure what the both() function adds to this kata, personally I probably wouldn't include it. That's my opinion anyway

  • Custom User Avatar

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

  • Custom User Avatar

    I belive this has now been resolved

  • Custom User Avatar

    I believe that is all sorted now, I made them both class methods because I think that fits better. Also put in the extra check you mentioned

  • Custom User Avatar

    I have made the changes, the tests I added aren't great but i'm unsure what the best method for creating randomized tests for the methods to clear the functions.

  • Custom User Avatar

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

  • Custom User Avatar

    Thank you for the feedback.

    • I'll take a look at the test cases and try to improve and expand them when I get a chance.
    • Regarging resetting the data, could you clarify what you mean by this. Do you mean a method to delete all the functions of a particular name? Would this be done through the class or the name of the function?
    • By the way I was also thinking of adding in something like addition of functions with + but I didn't really want to overcomplicate it, it could be interesting though. Thoughts on this?
  • Custom User Avatar

    My solution was using a class so I used UpperCase, do you think I should change it anyway as it is being used as a decorator? I'm not really sure what the convention would be here. I could also change my solution to just use a function instead, what do you think?

  • Custom User Avatar

    I'd love some feedback about what you think of this sort of Kata, it's quite different to others on Codewars but I found writing it quite interesting and i'd like to know what you think about solving it.
    Thanks

  • Custom User Avatar

    using python how do you modify a variable in-place inside a lambda function?

  • Custom User Avatar

    There is no 'n' so it is false