Apr-30-2020, 10:25 AM
Use always 3 temporary variables to address the 3-tuple that
os.walk()
yields. import os for root, dirs, files in os.walk('.'): for file in files: if '.py' in file: print(file)