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.
Me neither... Python will never ceases to surprise me. :)
That's not an issue. Your code is too slow. The 6s time limit exists to test performance.
You need to think of a better way calculate the answer.
The number
n
maybe as large as1000000000
.This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
that was a really smart way to using re.split ,bypassed a great deal of punctuation handling
nice work
Please mark all solution relevant texts as spoilers–even if you post a comment on a solution, and yes, even if you post in Chinese.
By the way, you will get more feedback if you write in English.
That being said, nice solution, although your explanation is a little bit wordy.
This comment is hidden because it contains spoiler information about the solution
You return
None
if the number isn't a square. For example youris_square(3)
isNone
. But it should beFalse
. This is also reported by the tests:(The number will of course vary)
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
i was maded the same mistake as you do, after desperately retring still failed ,i checked the solutions
then i found ,i was misunderstood the question .
the make_lazy function should return the function modding(*arg) itself ,but not the result of modding(*arg).
it's quite different .
this is why you got the error "TypeError: 'int' object is not callable":
you code:
this above of code return the result of modding(4,4) ,which is 0 ,that is a number.
but the Test program expected the first arg is the function .
so the test code will like this
so the type error occured .
this solution is best for the beginer to understand how to resove this problem