Ad
  • Custom User Avatar

    Your problem is due to how nested quotes are handled in Python 3.11 and beloww. As Codot 🤖 says:

    The issue in your code is the incorrect use of quotations within the f-string. When using a string inside another string, you must be careful with quote types to prevent them from being misinterpreted. In your f-string, the double quotes used for the split method are conflicting with the f-string quotes, leading to a syntax error. You may need to change the type of quotes used for one of the strings to ensure they do not interfere with each other.

    This behavior has been changed in Python 3.12, and nested quotes of the same kind work in newer versions of Python.

  • Custom User Avatar

    I don't know much Python, but my immediate guess is just different versions of Python.

    Either way, this is an issue in CodeWars, not this kata. I am going to mark this as resolved.

    I suggest you make a bug report to CodeWars, or ask on the Discord server.

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    This took way longer than it should have. But no timeout, which is a good thing.