Retired
Those élégantes unïcôdes, hiding in code wars... (retired)
20ebreton
Loading description...
Unicode
Fundamentals
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
Should mention in the description that some characters translate to multiple characters, and what exactly:
Æ
-->Ae
æ
-->ae
Þ
-->Th
þ
-->th
(this is a guess, haven't seen it in the tests)Also:
ß
-->B
? Phonetically it'sss
; but if you're translating the letters visually, thenÞ
should translate tob
orp
, notTh
...In addition to the "string_types" error below, when I have my solution also print my results in addition to returning them, I'm seeing this with Python 2:
Maybe I'm missing a big duh here, but those seem to be exactly the same.
Though as there are still (at least :-)) a couple things I need to clean up in my code, I think that maybe your tests have the expected vs actual backwards, so that the reason my output and the expected seem identical are because the error is also showing my output instead of the actual expected.
You are right! I was using your function instead of mine.
Should be corrected now. Thanks for the feedback :)
It worked for me now, thanks!
@ebreton
,I'm trying to submit a solution but I keep getting this error:
NameError: name 'string_types' is not defined
. It comes up when I clickRun Suite
and the first random tests start. Is that a variable you defined? (I haven't checked theTest Cases
code because I haven't been able to submit a solution successfully yet)I am not a fan of using a
for
loop in theExample Test Cases
. I think it goes against the Codewars Python Test docs and over-complicates theExample Test Cases
. The only reason I can really see it being used for is if you were going to use the input variables for something other than thetest.assert_equals
.In this case, you are using the
out
variable for atest.it
message but I would argue that it is unnecessary. If thetest.assert_equals
returnsFalse
, there is automatically a message of the format"{actual} should equal {expected}"
. In my opinion, that makes yourtest.it
message a duplicate of the default message but with half as much information (since the "actual" value is missing from yourtest.it
).Thanks again for writing these katas!
I'm getting the same error with the full test (though my solution runs fine with the example tests).
@tachyonlabs
,Ok, good to know it wasn't just me! I actually played around and made my own
string_types = (str,)
and then the error was something liketext_types
so I made one of those too, no luck so far.Right and right ^^
I missed an import in my test cases. Not flagged out because it is in my solution and the two are joined when the kata is validated. -> should be corrected now :)
I also modified the test samples. Thanks for the tip! makes sense
Cheers to both of you :)
@ebreton
,Ok, thanks for the fix! I'll try to solve it again in a little while.