Earn extra honor and gain new allies!
Honor is earned for each new codewarrior who joins.
Learn more
  • maybe it is not a complete newbie kata for 7kyu, actually, i think it need some skill to do this, should about 5.5 kyu

  • oops... x)

    • done: py3.6 available
    • I updated the description too (to have only the informations relative to the user's language)
  • Your sample test is missing the end paren and semicolon!

  • Sorry for the late reply. It says the test cases can no longer be edited, so I'm not sure what to do about that o-o

  • @nivrad00,

    Python 3 isn't available. Can be easily fixed by changing xrange -> range (twice).

  • @MrHobbits,

    Maybe the name of the function is confusing for Python. You need to write a function that converts a given LinkedList to list.

    I've never seen anything called LinkedList for python

    LinkedList is Linked list written in Python, nothing special.

    # In Python, lists will be represented by a preloaded LinkedList class with the members value and next. 
    class LinkedList:
        def __init__(self, value=0, next=None):
            self.value = value
            self.next = next
    
    # LinkedList(1, LinkedList(2, LinkedList(3)))
    

    I didn't/don't know how to access the items contained in the argument.

    Given above definition and usage, try to think of a way to go through every value :)

  • I found the instructions also confusing. Using python if you tried to print(lst) it gave some strange output (not 1, or any sort of list).

    I'm still new, and I've never seen anything called LinkedList for python so this whole kata threw me for a loop. If we execute dir(LinkedList) we don't get any useful information, help(LinkedList) also didn't help me much. So for me, it seemed to be a guessing game as to how we access the values in the lst.

    I understood what you wanted us to give you, but I didn't/don't know how to access the items contained in the argument.

  • Wow, for some reason I thought we had to make the LinkedList class as well, gg wp.

  • Because you don't have to test for anything above 1/2 the number... 2 is the lowest divisible number to check for. Saves computing time.

  • There is a great excercise similar to this challenge that includes this solution and goes deeper in Marjin Haverbeke's Eloquent JavaScript: Chapter 4. http://eloquentjavascript.net/04_data.html

  • num / 2 ? why? do you mean sqrt(num) ?

  • Cannot submit a successful answer in Python3 due to the use of xrange in the submission check. Please fix. Other than that, good kata and I have now been officially introduced to lower level data structures. And they are really interesting, so I am going to be doing some digging to learn more about them.

  • Yeah. I know what direction to go in. Thanks. ...and, sorry, if I made myself sound rude. I must of just came from stack overflow. :-D

  • This doesn't seem like an issue with the kata, so I'm going to resolve it unless anyone offers further insights

  • Loading more items...