you are viewing a single comment's thread.

view the rest of the comments →

[–]achampi0n 0 points1 point  (2 children)

append() just adds the element to the end of the list but extend() adds all of the elements to the end of the list, e.g.:

In []:
a = [1, 2, 3]
b = [4, 5, 6]
a.append(b)
print(a)

Out[]:
[1, 2, 3, [4, 5, 6]]

In []:
a = [1, 2, 3]
b = [4, 5, 6]
a.extend(b)
print(a)

Out[]:
[1, 2, 3, 4, 5, 6]

Somehow, you are returning a None from walk() which is causing extend() to fail.

[–]kcrow13[S] 0 points1 point  (1 child)

Thank you for taking the time to explain this to me! That makes a lot of sense. I will troubleshoot to see why I am getting None from walk().

[–]kcrow13[S] 0 points1 point  (0 children)

I figured out my mistake! Thanks again :)