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.
So happy I was able to get it"!!!
my eyes!
This comment is hidden because it contains spoiler information about the solution
Thanks.
This is called slicing and it's very common in Python. Do you know you can copy code and test it onn your computer to see how it works? You can even do it here, just click
fork
under any solution (though the site is currently down so it is probable it doesn't work right now).The line "if l!=2:" is redundant, though I also suggest using elif and else for clarity
nice one with list comprehension. I made a similar one but mine was a bit more complicated.
Well, I'm not sure about which part you don't understand, so I'll just explain the "non python" part.
First of all, note that this solution won't work in your IDE if you run it on a non Linux/BSD/UNIX system.
Python's prime factorisation utility is in module
sympy
which is not available in Codewars.Oddly enough, GNU Core Utils has one (for obscure historical reasons) and our playground is being run on Ubuntu Linux.
It's then just a matter of calling this
factor
utility from python viasubprocess
module and parsing the result.Can someone explain what this solution is actually doing? I have to say it's beyond my current understanding.