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.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
i like it
This comment is hidden because it contains spoiler information about the solution
don't work in editor!!!
how...
its the most 'pythonic' way to do it, so people mark it as best practices
This comment is hidden because it contains spoiler information about the solution
No, your if statement is more efficient. The max function spends a few more CPU cycles: https://github.com/python/cpython/blob/main/Python/bltinmodule.c#L1681
Nonetheless, I prefer the solution using 'max' because of readability.
That's because for the vast majority of lines of Python, you'll never notice the difference between them taking 10 operations or 100 operations, as CPUs are really fast. But if the next coder has a hard time reading what you wrote, then that will hold back the whole project.
In the rare cases where performance matters (i.e. in the most inner loop of the most runtime intense section of the program), I would care about performance. But then I wouldn't necessarily write that part in Python.
great! Is this more efficient than using an if statement? Is it easier to read?
Yours also a good one!
This comment is hidden because it contains spoiler information about the solution
Would have never thought of this..
what does this if s else s do? Wouldn't it just return the whole input in some cases?
Just beutiful <3
Loading more items...