Ad
  • Custom User Avatar

    Woops, you're damn right about the location of the error, sorry... :/ (I need holidays, it seems...).

    Tho, it still stands that the problem is in your code: the check function fails because you send to it an int instead of a sequence, meaning a list. ;)

    Note: when you post code, don't forget the spoiler flag and use proper markdowns so that it's easier to read it.

    EDIT: I see that there are no visible expected outputs in the sample tests. That's unfortunate... you need to return lists of integers, here.

  • Custom User Avatar

    hi,

    nope, your code isn't right. Just read the error message:

    File "/home/codewarrior/setup.py", line 3, in has_adjacents  <<<< your function
    for i in range(len(sequence) - 2):                           <<<< this line
    TypeError: object of type 'int' has no len()                 <<<< sequence is an int at this point in the executions
    

    Don't forget that sample tests are just "sample". Meaning that the full test suite contains many other tests, and there is at least one of them where your code fails.

    Further information:

    • use print to get the inputs and debug your code
    • Terminology used on cw:
      • Issue == dysfunctioning kata => that's not the case => closing
      • Question == the flag you should have used for this ;)

    cheers