Ad
  • Custom User Avatar

    It was a nice kata that I enjoyed a lot, except for the problem that there was an indication missing (candidates not mentioned in first place should be eliminated). I changed my code a lot because I thought I didn't handle the majority rule well for like 40 minutes before I checked the comments.

  • Custom User Avatar

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

  • Custom User Avatar

    Yes I used that. I searched around. My code can process half of the attempt cases well. It's just a problem when the user starts with his own level being different than -8 since I initialize it at -8. But I'll keep searching/trying.

  • Custom User Avatar

    You must use a __init__ function in your class, so it creates a new instance with properties you will need to get updated. Make a research online about Python classes, it's not reasonable to explain everything about them here. Or maybe try to practice this on very basic katas to get familiar with classes.

  • Custom User Avatar

    Hello. There is something I don't understand. I code with Python and I'm not used to classes yet. During some tests, the rank at the beginning is not -8 but another rank. Where is this information stored? Is it a variable? Where do we have to "search" it in the input you give to the machine? Since I don't really know what goes into the program, only what exits it, I'm at bit confused. I hope my question is clear enough.

  • Custom User Avatar

    No, it means you're trying to convert an empty string to an int.

    You can use this: print("newd: '" + newd + "'", flush = True) to see the value of newd.

  • Custom User Avatar

    I having an error Value Error: invalid literal for int() with base 10: ' '
    Does this mean the string I want to transform in int has some apostrophes in it ? Or some spaces ? It doesn't look like it but I can't test the code to know the output so I'm not sure.