Python's standard library functions are implemented in C, so not only is this solution cleaner, it's also significantly faster, than your reinvent-the-wheel solution.
For simple statements like this, it's quite pythonic to put it on one line. Even for more complicated statements with ifs and for loops and generators, it is still often pythonic to put it on one line.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
ok, that's your opinion, facts tell a different story on performance...
Python's standard library functions are implemented in C, so not only is this solution cleaner, it's also significantly faster, than your reinvent-the-wheel solution.
haha this one is savage
Get ahead with the times, people! /j
me too.
I have learned ,that's very beautiful!
same
u could do that at one liner
This comment is hidden because it contains spoiler information about the solution
i also thought this solution
we think same xd..... simplicity is best
is there any difference between this two very similar solutions?
For simple statements like this, it's quite pythonic to put it on one line. Even for more complicated statements with ifs and for loops and generators, it is still often pythonic to put it on one line.
YMMV in other languages.
Loading more items...