+ 1
Why is my code incorrect?
https://code.sololearn.com/cDT1wSk5DPzI/?ref=app https://www.sololearn.com/coach/16?ref=app
16 Answers
+ 2
I'm not sure. But maybe it is because the whitespace after the last word.
Could you try to put a whitespace only between words but not after the last one?
+ 2
HonFu is right. We don't have to use capitalization. See description:
Input Format
A string of the sentence in English that you need to translate into Pig Latin. (no punctuation or capitalization)
+ 2
HonFu Thomas thanks
But fixing it did not solve the problem.
+ 2
Ok, I'm wrong. I had a look on my solution. It also added a whitespace at the end. But passes all cases
+ 2
I could pass except #3
+ 2
Yes, I've tested it with same result. I hate things like this 😞
+ 2
I also had one more issue reported:
Someone checked for punctuation. That's also not needed. But when they did, there was a mistake.
Which can only mean, that they slipped in punctuation in one of the tests, right?
Which would be ridiculous. It's like they were saying: 'Hey, what's up with you? Your code doesn't even run with crappy input!!!'
So just split the string in words, not regex it for all being letters (that's what you are doing, right?), and try again.
+ 2
HonFu thank you so much!!
I could solve this problem!
+ 2
Nice, finally! :)
+ 1
I have heard a few times that downcasing stuff led to problems.
The task means: Don't bother with upper/lower.
But if you do anyway, you get an error (which doesn't really make sense, but anyway).
So I'd try just that, take out the downcase call and see.
+ 1
Okay, shoot...😅
+ 1
Focus
0
it worked for me..
0
I could also pass expect #3
- 1
Х Привет
- 1
Люди