That doesn't solve the problem. Re-read the problem and try again :)
Actually your problem doesn't clarify that a polydivisible number can't begin with 0. I can see how the op could misinterpret the instructions.
Can someone please break down why my code didn't work? I thought I produced efficient code:
def polydivisible(x): return isinstance(x / len(str(x)), int) polydivisible(1232)
thanks!
Added :)
yes! I adapted JohanWiltink's code for this translation
Do the random test cases include random polydivisible numbers? (Read the third-to-bottom thread)
I was sure I just fixed that. Definitely fixed now.
Liked it. Passed the final attempt with all the cases, but the sample test returns an error: /home/codewarrior/node/test.js:18 } ^
True. My bad, thank you.
JavaScript should use Test.assertDeepEquals/chai.assert.deepEqual.
Test.assertDeepEquals
chai.assert.deepEqual
Not an issue, your solution violates the requirements about unused coins.
Returns what's needed, everything is correct. But there are some inbetween tests where 'undefined' is expected, and my code returns 0. Language: JS.
Loading collection data...
Actually your problem doesn't clarify that a polydivisible number can't begin with 0. I can see how the op could misinterpret the instructions.
That doesn't solve the problem. Re-read the problem and try again :)
Can someone please break down why my code didn't work? I thought I produced efficient code:
thanks!
Added :)
yes! I adapted JohanWiltink's code for this translation
Do the random test cases include random polydivisible numbers? (Read the third-to-bottom thread)
I was sure I just fixed that. Definitely fixed now.
Liked it.
Passed the final attempt with all the cases, but the sample test returns an error:
/home/codewarrior/node/test.js:18
}
^
True. My bad, thank you.
JavaScript should use
Test.assertDeepEquals
/chai.assert.deepEqual
.Not an issue, your solution violates the requirements about unused coins.
Returns what's needed, everything is correct. But there are some inbetween tests where 'undefined' is expected, and my code returns 0.
Language: JS.