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.
How does this work?
I missed that, because I was expecting it to be under code limits, (as it's a constraint on the code). Wouldn't hurt anyone if it was added there.
Please read the title.
Would be nice if you mentioned, that it has to be a one-liner.
This comment is hidden because it contains spoiler information about the solution
Hi @lechaim - I tried troubleshooting your error; are you sure that you are reading the test outputs correctly?
There is a test with input 1000000000 that expects: 350704366
There is a test with input 2147483647 that expects: 1485607536
Both the numbers you have in your post seem to correspond to expected answers, but for different inputs?
Check the troubleshooting guide also to learn how to print the inputs to console, so you can better debug your code.
Fun kata. I usually enjoy the challenge of these number series kata, as I did with this one. But I see some of the fibonacci kata authors state the zero term is zero ie..
fibonacci(0) = 0. Shouldnt the zero term not be a term at all?
first, second, and third term should look like this, no?
fibonacci(1) --> 0.
fibonacci(2) --> 1.
fibonacci(3) --> 1.
And so on..
Anyway, thanks for a great kata.
Hi @horriblepythoncoder (nice name btw!) and welcome to Codewars.
There are a few things you need to know about submitting solutions:
You must not change the name of the function Codewars "expects" to see in its tests. Here the kata is expecting you to write your code in a function named
even_fib(n)
- in other words, whatever this function returns is what Codewars considers your answer. You don't have a function with this name in your solution, so Codewars can't "see" what you are doing.Related to 1, you must return your solution, not just
print(even_list)
to your console.Remove all the stuff in your solution about
input()
and so on, and just write a function that will accept an inputn
and return the demanded answer. Codewars tests will pass the values ofn
for you.This comment is hidden because it contains spoiler information about the solution