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.
omg
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:
I dont C/P. I am printed, dude...
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?
did not want to type "return" each time but now I realise, that typing "return" is a lot more convenient that typing "="-symbols...
ah i see thank you
For a number of 2 or more digits, the last 2 digits determine whether it is divisible by 4.
([02468][048]|[13579][26])
matches all combinations of the last 2 digits that would make the number divisible by 4.what's this for actualy ? is it default value[02468][048][13579][26]
Copy/paste from Details )
This comment is hidden because it contains spoiler information about the solution
If n is list then this solution will mutate argument. Mutating argments inside the function is bad practice because can cause unexpected behaviour somewhere outside the function
This comment is hidden because it contains spoiler information about the solution
I really love your compact solution. I would really appreciate it if you could explain it to me!! Thanks
Assumes the string contains no tabs, newlines or repeated spaces.
Loading more items...