<s>[INST] How can I iterate over files in a given directory? I need to iterate through all .asm files of a given directory and do some actions on them. 
How can this be done in a efficient way?
 [/INST] for filename in os.listdir(directory):
    if filename.endswith(".asm") or filename.endswith(".py"): 
        # print(os.path.join(directory, filename))
        continue
    else:
        continue

 </s>