What a pythonic code,someone who doesn't use python is hard to understand.
If it is, that should be tested.
Well, it is bad.-
guys, one line solution looks very impressive.
But are you sure that such code is readable (especially for a developer with little experience)? :)
I have The same input. But this will not work on other type of strings like "i am 7 years".
I read it in book that string can be multiplied with integers
nice and clean solution of course
Can you show your timings? I believe this should be rather fast for the return True case. Also, LBYL is arguably idomatic and 'normal' in Python
Plus, casting a string to a float is not doing any good here.
Exception handling takes longer than a normal solution.
How is this slow?
One of the slowest solutions!
Rest of the code is pretty much self-explained but I can't understand why we need the integer 2 in the end, please explain to me what is the purpose of declaring 2 in this code? Thanks
Best Practice but adding a comment would have sent the solution to Mars!
This comment is hidden because it contains spoiler information about the solution