I want to raise an exception with the name of the file that is missing:
f1 = Path(DIR_PATH, "one.txt").resolve()
f2 = Path(DIR_PATH, "two.txt").resolve()
# 1 Is there a way of doing this?
if not f1.exists() or not f2.exists():
raise Exception(f"The file {?} does not exist")
# 2 instead of this
if not f1.exists():
raise Exception(f"The file {f1} does not exist")
elif not f2.exists():
raise Exception(f"The file {f2} does not exist")
Is there a way of doing #1 rather than #2 from the above code?