8 kyu
Ensure question
233 of 10,766Spadavecchia
Loading description...
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.
Scala translation
Approved
CoffeeScript translation
Approved
test.assert_equals(ensure_question("Well????"),"Well????","Expected: '?'")
The above test was included in the 'basic tests' but is missing from the test cases.
Random tests never generate test cases with multiple '?'
Fork resoloving
C# translation ready! Please review and approve.
There's only one test case with mutiple question marks. Some random tests are required with multiple question marks.
Fixed in Python at least.
I would have had this one but for one mistake. You also have to assume (s) is and empty string. Which means my s[-1] would not work and kept throwing 'out of index' errors. Could not figure it out lol until I gave up and looked at solutions.
not a suggestion.
This comment has been hidden.
This comment has been hidden.
you need to return the value, not print
Hello, friends! Sorry, I'm only start to learn Javascript.
I write a simple if else code. Here is my code:
function ensureQuestion() { let someText = 'sometextinfo' someText.endsWith('?') ? console.log(someText) : console.log(someText + '?') }
ensureQuestion()
Can someone look, where I'm goes wrong? Because my function just checking, if someText variable end with '?', then we just show this variable. If not, we will add "?" at the end. But tests can't accept my code (in Visual Studio Code everything works correct).
This comment has been hidden.
This comment has been hidden.
Please read this: https://docs.codewars.com/training/troubleshooting/ and don't post your code without marking your post as having spoiler content next time.
There is no problem with the tests, there are no
!
in the strings at all, they're simply words with or without a trailing?
missing test cases: "test? ", "?test", "test? test", "test?? test" especially the last one to prevent simply adding a "?", then replacing "??" by "?"
Forked python translation kumited, please check and approve as this is my 2nd translation
Nice kata! As a suggestion, I would add some more strings to be tested that have more than one question in it, as we can pass the kata with the method "include", which is not entirely correct for the purpose of the exercise I believe, as we want to check if the string passed as argument of the method ends with a "?", rather than if it contains it somewhere.
This comment has been hidden.
This comment has been hidden.
I do not understand a single thing about this. Please help
I agree, its not a 8kyu question
Javascript and Python translations, please check and approve :-)