Ad
  • Default User Avatar

    This is an instructive kata. Earlier, I spent a lot of time solving similar type of kata. Now, I know what the trick is here.

    Thank you, constructor!

  • Default User Avatar

    My opinion: This is an skillful solution that only someone familiar with the intricacies of python can do.

  • Default User Avatar

    Now I have solved the kata. Thank you.

    For many of us, failure being a little bit demoralizing.

    I am aware that I have a path to follow patiently. No pain no gain, for me.

  • Default User Avatar

    @benjaminzwhite thakns for your time.

    While trying to solve this kata last week, I read the link you sent. I read it again today. I also watched some video tutorials. I worked for this kata for more than 4 hours in total. I guess I don't understand what kata wants from me.

    
    except ValueError:
    
    

    I can't understand what kind of output we are expected to produce after the code phase. For example, I tried the Gamma function to avoid errors with negative numbers.

    
    except ValueError:
         math.gamma(n+1)
    
    

    Or so that the code does nothing, I write things like:

    
    except ValueError:
         pass
    
    

    or

    
    except ValueError:
         return None
    
    

    Of course, my work has not been completely garbage. I learned something.

    I am currently unable to figure out what the problem is asking me to print with values outside the desired range.

    Maybe it would make more sense for me to take a break and try again next week.

    My experience may be insufficient for today.

  • Default User Avatar

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

  • Default User Avatar

    I recommend adding the following or similar information to Kata:

    Definition of Value of a Color: For a given color = "#PQRSTU", the maximum of PQ, RS, TU hexadecimal numbers.

    Definition of Brightest Function: The first object in the Colors list that has the largest Value(V).

    It will be an important and beneficial data for problem solvers.

  • Default User Avatar

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

  • Default User Avatar

    Thanks akar-0. Now I have completed the kata with your information.

  • Default User Avatar

    Hi, How can I get the values of a Tuple? Like this:
    def mag_number(info: Tuple[str, int])

    Here are my efforts on the problem:
    I read some pages about the structure Tuple[str, int]. First element is a string and second element is an integer.
    But I didn't apply this information on the problem. Also,
    when x = tuple((2,3,5)), I can find the values. For example x[0] --> 2
    With similar idea, I tried Tuple[str, int][0] , Tuple[str, int][1] and they didn't work.

    I would appreciate if you could share a page explaining the working of this kind of code with an example. https://docs.python.org/3/library/typing.html didn't help me much.

  • Default User Avatar

    "Tip: Some languages have a way to make parameters optional."

    In order to learn this method, I accepted to open a solution in another kata without gaining any points. I gained this kata by sacrificing the other kata. Opening a solution feels unsuccessful and hurts a bit, but I think it's fair. Because in return we can learn a method. I must also say that I spent more than 2 hours in total for both katas at 8 kyu level. I did not surrender easily.

  • Default User Avatar

    It is a tutorial kata showing how we can apply the format function to a list of multiple objects.

  • Default User Avatar

    We are a very kind sheep farmer. I really liked Kata's story :)

  • Default User Avatar

    Personally, I prefer to work with well-defined problems. Let me explain: what's the next term in the sequence 1,2,3,4? You can simply say 5. These are terms of the sequence f(n) = n, right? So the answer cannot be 29? The terms of the sequence g(n) = (n-1)(n-2)(n-3)(n-4) + n also satisfy this rule. In other words, it is not a mathematically correct method to obtain a rule by looking at a few examples. For this reason, I do not like this kind of kata.

  • Default User Avatar

    When a positive integer n is written as the sum of several positive integers, when does the product of the terms that make up the sum reach its maximum value? I presented this problem to my students in my middle school mathematics olympiad classes years ago.

    For this kata, it will be very helpful to examine the problem using pen and paper for cases n = 1, 2, 3, ... 12.

  • Default User Avatar

    There was no error in my code in terms of math operation. Due to Python's limitations, the division of two very large integers, one a multiple of the other, was causing an error. It took me hours to get over this problem. I hope one day I can solve it much faster.

  • Loading more items...