Ad
  • Default User Avatar

    Running my solution in Python compiler it runs fine - and test examples return correct answers. When I enter this into codewars it fails. For example, it gives error message:

    ✘ [3] should equal 3

    when my solution does return 3. Have other python users experienced similar issues? I note a similar post from shpilliwilliams(7 kyu) 4 weeks ago.

  • Default User Avatar

    I am also experiencing similar problems with the population growth challenge.

    Test.describe("nb_year")
    Test.it("Basic tests")
    Test.assert_equals(nb_year(1500, 5, 100, 5000), 15)
    Test.assert_equals(nb_year(1500000, 2.5, 10000, 2000000), 10)
    Test.assert_equals(nb_year(1500000, 0.25, 1000, 2000000), 94)

    I am failing the top basic test - returning 17.
    And failing the bottom basic test, returning 96. But calculating these on a BAII suggests that 17 and 96 are the correct answers. Am I missing something here? I assumed initially I had some float/int rounding errors but can't see an obvious solution beyond what I have already.