Hy guys!
Today I'm going to share with you the best tips and tricks to master in Python!
These tips are based on my experience on Codingame, duri...
Some comments have been hidden by the post's author - find out more
For further actions, you may consider blocking this person and/or reporting abuse
I see myself coming to this article again and again in the future
Dear friend,
Your website does not have three links working, as far as I can see.
Yeah !!!
Because it is in under-construction....
Hey are you on in instagram follow my id is zastixx
Thank you very much !
A neat trick with sets
will give you
There is also the reverse() method which reverses the list in-place, while [::-1] gives a new list in reversed order.
gives you
Happy Coding
Yes! For the first trick, it is a very cool property of the set function to get unique values.
For the second trick, I explained in my post that this built-in function is much slower, but it is probably easier to remember, I admit :)
nice I didn't know some of that, like the
a, *b, c = l
thing andimport this
lol very coolJust a quick note (that can count as another trick): you can simplify the
my_filter
function to thereturn x==3 or x%2==0
It's true that you can use that, but I wanted to keep it pretty clear in my post. But your trick is useful in "small" functions like this one to avoid making the code ugly