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
If the number is negative, it is not a prime by definition. Using the absolute value would result in incorrect responses.
This comment is hidden because it contains spoiler information about the solution
That's right, comment edited.
Thanks.
It hasn't been removed, just moved to
functools
.There you go!
https://docs.python.org/2/library/functions.html#reduce
I need help with the second function. I am not able to clearly understand the usage of alphabets, could anyone explain it in a little more detail? Does it mean that we need to assign certain numerical values to these alphabets as well?
Thank you!!
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
what is reduce, what does it do?
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
speechless it is amazing. masterpiece..
the question also prompted for negative inputs. Of course mathematically we define for positive integers.
just add a line of code
num = abs(num)
Loading more items...