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.
One floor:
Four floors:
Practially, it doesn't make any difference. The init method automatically returns none, so you don't need to include that instruction in your code. The 'pass' keyword does nothing, it is basically just a placeholder to keep Python from getting angry that you didn't include an indented block in the init method. If you used an empty return, or return None, you'd get the same results, you're just doing a little more work than you need to.
@moonrhino68, I think that on the pc on which you can use the shortcuts has No Editting Mode Enabled(VIM or ENAC), while on the other pc anyone of them is enabled.
No, I think it's the same... if you don't need pi outside the function.
This comment is hidden because it contains spoiler information about the solution
['gather', 'field', 'wheat']
defines a directional edge, or arrow, which begins at the node called'field'
and terminates at the node called'wheat'
.I.e. to get from the
'field'
node to the'wheat'
node, that arrow indicates that you could do so directly. However the arrow is one-way; you can't go in the reverse direction unless there's another arrow in the reverse direction.Did you trim the spaces from the end of each line?
Are you in any special mode? (emacs, vim?)
The
for( var i in arr )
statement coercesi
to a string.The expected value is a number.
So the error message "
Expected 5, instead got 5
" means it expects a5
not a'5'
.Modify your
for
statement, you'll don't need toparseInt
the index result.(first case passes because index was
0
)You need to return a function from the method
getSequence
, which calculates the 'nth term' for any given value of n.So getSequence([1,2,3,4,5])(10) is equal to calling yourNewSequence(10), which should then calculate f(10) for the sequence [1,2,3,4,5].
Sorry if this isn't very clear!
console.log
do work on codewars. The log output is directed to the Output window.