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.
@noweare
yes, it is one of the greatest features of this site
It return not function and the value of variable that keep the function.
Sorry, my english isn't good. I hope you will understand my explanation.
This comment is hidden because it contains spoiler information about the solution
IKR SAME ;((
I pretty much as well considering this a "hack"
This comment is hidden because it contains spoiler information about the solution
Me too, i think i learn more by others solutions
This comment is hidden because it contains spoiler information about the solution
Still isn't true at all. In programmation world, you don't try to reinvent the wheel at every moment.
Thank you so much :) That's so kind :)
I wanted the code to be performant, not just to do the naive approach of "add-everything-then-do-modulo" ;) Instead I aimed to save on computational complexity and on memory.
In hindsight, I should have used a hashset instead of a tuple for the "odds", but it's such a small set, it probably doesn't matter.
Anyway, thanks again :)
not really
imo since being even and odd is kinda like a binary toggle, there's no need to have if followed by else and another if followed by else. cleanest would be a simple if is_Even(n):... else:...