Ad
  • Custom User Avatar
  • Custom User Avatar

    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.

  • Custom User Avatar

    Please read the title.

  • Custom User Avatar

    Would be nice if you mentioned, that it has to be a one-liner.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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.

  • Custom User Avatar

    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.

  • Custom User Avatar

    Hi @horriblepythoncoder (nice name btw!) and welcome to Codewars.

    There are a few things you need to know about submitting solutions:

    1. 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.

    2. 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 input n and return the demanded answer. Codewars tests will pass the values of n for you.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution