Is there a way to so some type of set of file extension types instead of all of the redundant OR conditions?
for file in os.listdir(source_directory): if file.endswith(".xlsx") or file.endswith(".xls") or file.endswith(".xlsm") or file.endswith(".xlsb"): So something like
if file.endswith(".xlsx","xls","xlsm","xlsb"):
file.endswith((".xlsx","xls","xlsm","xlsb")):