Ad
  • Custom User Avatar

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

  • Custom User Avatar

    Python:

    Write a function f(n), which returns the n-th member of sequence.

    Function name is sequence(n)

  • Custom User Avatar

    in Javascript, the error message is somewhat useless:

    expected 17673 to equal 5279274
    

    It would be interesting to know for which ordinal number in the sequence this is.

  • Custom User Avatar

    Hey I'm a bit confused by the description. Can someone tell me what is my function supposed to return here??

  • Custom User Avatar

    Can someone help me with generators?
    I use python and the poblem is that i cant get the numbers to evaluate the steps.

    function(nothing):
    code

    How can i with this type of func structure get the numbers to computate steps?
    It would be much easier if the func was

    function(num):
    code

    can you give me advice?

  • Custom User Avatar
    Traceback (most recent call last):
      File "tests.py", line 1, in <module>
        from solution import *
      File "/workspace/default/solution.py", line 1, in <module>
        from preloaded import *
      File "/workspace/default/preloaded.py", line 7, in <module>
        codewars_test.expect(len(source) < k, True, "Length of code must not exceed {} symbols. Do not hardcode answers.")
      File "/workspace/default/src/codewars-test/codewars_test/test_framework.py", line 22, in expect
        display('FAILED', message)
      File "/workspace/default/src/codewars-test/codewars_test/test_framework.py", line 14, in display
        type.upper(), mode.upper(), label, format_message(message)))
      File "/workspace/default/src/codewars-test/codewars_test/test_framework.py", line 9, in format_message
        return message.replace("\n", "<:LF:>")
    AttributeError: 'bool' object has no attribute 'replace'
    

    This is not the most friendly way to - I think - fail overly long source code. Can't you just fail a test ( preferably while also testing the values ) ?

    ( I just wanted to know if my values are correct. )

  • Custom User Avatar

    You should avoid byte conversion and give BASE_75 as a binary string - since any character is ascii encoded and takes only 1 byte.

  • Custom User Avatar

    I'm really lost here... how come sequence(5) should return 10??
    Doesn't 0,5,10 form arithmic progression? Shouldn't it be 12 instead??

    Also, is the given input part of the sequence or not?

    I feel like this kata doesn't give enough examples, could have put in more examples, for example sequence(6), sequence(7).