Ad
  • Default User Avatar

    "A lot of these questions are made intentially vague or weirdly worded to increase difficulty and to make you think a little more". No, it's called bad English. We come here to test our ability to think programmatically, not to try and improve our ability to interpret poorly written text.

  • Custom User Avatar

    study on what self does, and how instances of classes work

    class RandomClass():
      def __init__(self, INPUT1, INPUT2, etc..):
        self.INPUT1 = INPUT1   # this takes the inputs and makes them part of the class..
        self.INPUT2 = INPUT2
        self.hiddendata = ["data", "accessed", "by", "entire", "class"] # data that is inate to the class
        
      def add(self, input1, input2):     #self here as well. so you can access self.hiddendata for example
        return self.hiddendata, input1 + input2
    

    there is only 1 object tested. example:

    x = Arith("five")
    print(x.add("seven"))
    this should return "twelve"

  • Default User Avatar

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

  • Default User Avatar

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

  • Default User Avatar

    Yo PLEASE unlock that for Python 3. Took me long enough to find out why all my answers are changed to 0 out of nowhere when it worked fine on my PC.

    Reason is that Python 2 handles the '/' operator different than Python 3

  • Default User Avatar

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

  • Default User Avatar

    Hey could I get the number n at which the error occurs? Currentely I cannot recreate the error on my machine. At some random numbers I get an error, example:

    Hihger Values of n (From 1000000 up to 5000000)
    1048447 should equal 1288849

    Unfortunately it does not tell me what n was.

    Running numbers through my code bigger than the ones given always gives me the right answer. I'm kinda hung up here. I'll leave my code in a reply to this comment.

  • Default User Avatar

    I need a bit of a headstart here? I can't just use itertools.permutations, but neither can I write a self prolonging nested for loop.

    Does anyone have a bit of advice for me?

  • Default User Avatar

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

  • Default User Avatar

    You're right, sorry. I am using Python.

  • Custom User Avatar

    Please specify the language you are using?

  • Default User Avatar

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

  • Default User Avatar

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

  • Default User Avatar

    Hi iphark. For this particular kata, research "lookahead assertion", "character set", and how the ^ (carat) and $ (dollar sign) work in regex. Hopefully this helped!

  • Default User Avatar

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

  • Loading more items...