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
It's a clever solution, so you ask this:
For that loop, but I think it would be better with a+c "<" b.
Because, it's part of triangle existence theorem.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
It's a good solution.
I didn't know about filter function only needs a conditional to filter lists.
Well. It was more simple solution than mine.
It's a method to ignore specific values.
For instance:
a,_,b = (1,2,3)
Then: a=1 and b=3
Another example:
a,*_, b = (1,2,3,4,5,6,7,8)
a = 1 and b = 8
Other function to this is save the last result in "_" variable.
So if you do this:
2+4 -> result= 6
_ -> result= 6 #save the last result in your program.
For separate numbers:
But you can do:
This link helps so much: https://www.datacamp.com/tutorial/role-underscore-python
It's a great and clever solution, you don't need to add new variables.
You just use the last element of the list.
And you are very intelligent to put in the second order this: item != res[-1]
Because of the lazy evaluation. Only it's evaluated the first bool result if it's a empty list
so you don't need to worry of the second one.
Thank you :)
Than you, for not convert it to numbers again.
Well, I was convert it to string again, after I sorted numbers.
But, according to python docs:
So it's unnecessary to try to convert it to a number again. because sort() and sorted() do the same thing with integers and strings, but only if both are numbers.
This comment is hidden because it contains spoiler information about the solution
Please use spoiler flag next time.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
There is a rule, "simple is better than complex".
It's due to is more simple do code inside of def function
rather than do a lambda function.
But it's definetly very clever solution :)
Loading more items...