Ad
  • Custom User Avatar

    No real need for the extra line in compile, match will take the pattern as arg

  • Custom User Avatar

    manual notifiation, see above

    note: think about the spoiler flag, btw.

  • Custom User Avatar

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

  • Custom User Avatar

    I added a preloaded utility function esc_html that deals with these shenanigans, so you can safely debug your code with printing. I hope this helps, I am resolving this issue (it's not a kata issue to begin with).

  • Custom User Avatar

    I've copied your solution to see what's the case. The formatting IS happening, take a look at the messages the tests are returning - your strings do contain proper tags, just missing some implementation details. Printing the results, however, is problematic; as I mentioned, Codewars is processing HTML tags, not escaping them, so e.g. if you have a string <th>o</th> (notice that here the angle brackets are escaped, because of the backtick markup!), when printing to the stdout it will show only o, but upon inspection (ctrl + shift + c in Chrome), you will see that <th> tags are there. If you want to debug it via print, I suggest doing it like so: print(str_to_be_printed.replace("<", "_").replace(">", "_")), it should work.

  • Custom User Avatar

    Are tests failing, or you just don't see the expected output via printing to the stdout? HTML tags are processed by Codewars so you need to be careful debugging it like this. Not sure if there's an issue with the kata.

  • Default User Avatar

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

  • Custom User Avatar

    The description clearly explains everything:

    It leaves at an empty th but it does not specify under what circumstances it should be so --> If headers arguments is True, this column should have empty header.

    The items in the data with None, should match an empty '' string, not specified in the instructions either --> IMPORTANT NOTE: if the value in the array happens to be None, the value of the according cell in the table should be en ampty string ("")!

  • Custom User Avatar

    There are some conditions in the testing, which are not outlined in the instructions or at least it is not clear to me.

    table>thead>tr>th>/th>th>lorem/th>....

    It leaves at an empty th>/th> but it does not specify under what circumstances it should be so

    The items in the data with None, should match an empty '' string, not specified in the instructions either.

    **Sorry cannot complete the HTML tags, because they dont appear in the comment

  • Default User Avatar

    "The tests will always use some integral number [...]" see description.

  • Default User Avatar

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

  • Custom User Avatar

    Thank you for your feedback guys. I imported this solution from another user and did not pay enough attention. It has been fixed

  • Custom User Avatar

    @zebulan you quote PEP8 like the Bible, I see you talking about it every day :D.

  • Custom User Avatar

    @nicolassilva is right. According to Python's PEP8, get_real_floor is correct because it uses snake_case.

    The only thing that needs to be changed are the function names for the example test cases to match get_real_floor.

  • Custom User Avatar

    @nicolassilva,

    Thanks for the comment, I enjoy learning from other solutions on Codewars.

    Just to clarify, I didn't use a dict in my solution, WORDS is a tuple. But I understand your point.

  • Loading more items...