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

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

  • 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

    Hi - my best advice would be to read the helpful Python docs; try to copy the example code given in your local IDE, and also Google any new concepts/words that you don't understand.

    After you read Sections 8.1 to 8.4 of this page, you should find your answer!

    https://docs.python.org/3/tutorial/errors.html

  • 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

  • Custom User Avatar

    This kata uses typing. Most Python katas don't. Look at the documentation of this module if you face another difficulty with this.

  • Default User Avatar

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

  • Custom User Avatar
  • 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.

  • Loading more items...