Let’s start by defining our
TreeNode class. We’ll begin with having our node store a value, and additional functionality can be layered on in the following exercises.
Within script.py define an empty
TreeNode class, define an
__init__() method that takes
value as parameters. Print “initializing node…” within
Nice work! Make an instance of
TreeNode and give it the value of your name as a string. Assign this to the variable: