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.
If you mean the alphabetical order of stock names, they are irrelevant here.
The task asks only to compute the final
buy
andsell
values, and mark any badly formatted stocks.This comment is hidden because it contains spoiler information about the solution
Initial sequence:
1,2,3,4,5,6,7,8,9,10,11...infinity
Delete every second number:
1,3,5,7,9,11...infinity.
From this new sequence, where 3 is no longer the third number, then delete each 3erd number (5, 11, etc.)
I am not shure ho pythonic the solution is.
It is readable and performant.
Your solution includes an additional variable. That can make it more readable, but since the function does exactly one thing (calculating a grade), I dont think this adds to the readability.
The multiple return statements...hmm yes I dont like them that much but since python does not offer a clean switch case out of the box...well.
Multiple return statements are not forbidden, but I guess PEP8 somewhat discourages you to use them.
But at the same time, some examples in the style guide also contain multiple return statements.
So maybe (and I mean maybe) it is fine in this case...
I'm not sure whether or not it's pythonic, but it seems that from efficiency point of view:
From a readability standpoint I like this solution.
I thought I read that multiple
return
statements weren't pythonic. Is this not the case? See my solution as an example.I think this solution is actually easier to read. Although, I can see where multiple
return
's might get complicated quickly.Thoughts?
The restrictins in Python are ridiculous and don't allow for much variety in or elegant solutions.
The Python translation is getting warnings, too:
/workspace/default/preloaded.py:34: FutureWarning: Possible nested set at position 1
parse(re.finditer(f'[[\]]|[^[\]]+',solution))
Looks like f-strings aren't needed here, and
re.finditer(r'\\|[^\\]+'), solution)
will do what the above code seems to be trying to do.This comment is hidden because it contains spoiler information about the solution
did not want to type "return" each time but now I realise, that typing "return" is a lot more convenient that typing "="-symbols...
I had a very similar error. I submitted again without changing any of my code and it accepted. It seems like the tests are not consistent
me too
This solution is wrong, it does not cover all edge cases.
it just got lucky with the random test cases.
Replace f' formatting with .format()
This comment is hidden because it contains spoiler information about the solution
Loading more items...