1def to_string(node):
2 def actual_recursive(node):
3 nonlocal a_str # ~global, can modify surrounding function's scope.
4 a_str += str(node.val)
5 if node.next != None:
6 actual_recursive(node.next)
7 a_str = ''
8 actual_recursive(node)
9 return a_str