My task is to create a list of lists which contain relative and absolute paths of all sql files in my search\_dir folder.

The problem is that I can't know beforehand how many files (lists) should my main list contains.

Is there any way to append lists on the run?

```
cnt_of_sql_files = 0

for dirpath, subdirs, files in walk(search_dir):
    for file in files:
        if file.endswith('.sql'):
            cnt_of_sql_files +=1

scripts = [[]] * cnt_of_sql_files 

for dirpath, subdirs, files in walk(search_dir):
    for file in files:
        if file.endswith('.sql'):
            for index in range(cnt_of_sql_files):
                scripts[index] = [path.join(dirpath, file),
                              path.join(path.basename(dirpath), file)]
print(scripts)

```