Back to Freecodecamp

Step 3

curriculum/challenges/english/blocks/learn-tree-traversal-by-building-a-binary-search-tree/65c4f013851cefd1a4fe4c96.md

latest665 B
Original Source

--description--

The __init__ method takes two parameters: self (which represents the instance of the class being created) and key (the value to be stored in the node). Add those two parameters to the __init__() method.

--hints--

You should add the self parameter to the method.

js
({ test: () => assert.match(code, /def\s+__init__\s*\(\s*self\s*/) });

You should add the key parameter to the method.

js
({
  test: () => assert.match(code, /def\s+__init__\s*\(\s*self\s*,\s*key\s*\)/)
});

--seed--

--seed-contents--

py
--fcc-editable-region--
class TreeNode:
    def __init__():
        pass
--fcc-editable-region--