Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Because your code is wrong. Read the description of the Kata again.
Can you please explain in more detail what you're asking?
why they return the answer wrong?????
@mmangiamusardo please mark your post as having spoiler content next time.
This comment is hidden because it contains spoiler information about the solution
F-strings:
For most cases, f-strings are the best choice. They're concise, readable, and performant.
.format() method:
If you need to support older Python versions or want more complex formatting options, use .format().
Old-style % formatting:
Avoid this method for new code, but be able to recognize it in legacy code.
Skill issue?
But yes, this would be a lot easier if the method/function took an
int
array as input. But then this kata would be even easier and not as fun.This comment is hidden because it contains spoiler information about the solution
No, I mean you are using the
max
andmin
functions on a list of strings. The way you sort a list of strings is different form how you sort a list of numbers.See: https://www.codewars.com/kata/554b4ac871d6813a03000035/discuss#60cb692f9c75d0003d7b9a79
This is python.
Yes, the instruction asked to return a string of numbers separated by a single space
Even after moving the logic out of the loop, it still gives same test error
Which programming language is this?
The issue is definitely your code, and my first guess is that you are sorting a list of strings, instead of a list of numbers.
Other than that, you are doing things in a loop for some reason, so you are finding the highest and lowest values multiple times.
This comment is hidden because it contains spoiler information about the solution
The tests are fine in javascript, it's your code that's returning the wrong answer:
Not a kata issue.
Which programming language? And what was the exact output of the failed test case?
I highly doubt there is an issue though, unless this is a very recently added translation. Since this kata has thousands of completions.
the tests do not work correctly. they do not return the highest and lowest. like in this case: [
'8', '3', '-5', '42',
'-1', '0', '0', '-9',
'4', '7', '4', '-4'
], it expected '8 -1'.
Loading more items...