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.
'is' also does typecheck (in context of this kata)
I made similar code using entered_code == correct_code and got failed test, but when I used 'is' it passed, why ?
is
is the only functioning solution; it randomly fails with==
for some reason. ¯\_(ツ)_/¯I can't believe I had to use the datetime library, good solution!
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This solution will NOT work with the long strings.
For example, the values
entered_code = 5000 * '11'
correct_code = 10000 * '1'
will result to False!
(_O___O)
one line... (
Goddamnit why doesn't my googling give me this stuff??"??
'is' is not the same as '=='. Sorry.
is operator checks for object identity. I don't think coupons with same code value should be guarnteed to be identical objects. Thus, the fact that 'is' works is just luck -- the tester passes same objects, that's all