I get the desired result from using print() but I want the same result when using a return. How can I change this to a return? When I do it only returns the first key, value where I want to have the four that are in the BST.
def inOrder(self, aNode):
if aNode:
self.inOrder (aNode.leftChild)
print (aNode.key + ' ' + aNode.payload +'\n')
self.inOrder (aNode.rightChild)
The result I am looking for is to have four keys followed by their value.