I'm trying to write a function that will basically print:
file1
file2
file3
file4
file5
file6
file7
When I enter:
C = [['file1', [['file2']], ['file3', 'file4', 'file5']], 'file6', ['file7']]
It's supposed to be like a directory.
Here is my code:
def tree_traverse(directory) :
list1 = list(directory)
for it in list1 :
if it == 'Cc' :
del(list1[:(list1[it]+3)])
for item in directory :
print(item)
Whenever I enter the input above, I get an error saying C is an unexpected argument. Also, when I enter the above input without the "C = ", it just prints it like I entered it. I'm quite lost at what to do.