try changing the inner loop to something like this
results += [each for each in os.listdir(folder) if each.endswith('.c')]
try changing the inner loop to something like this
results += [each for each in os.listdir(folder) if each.endswith('.c')]