1# Aim: Program to perform image to PDF conversion (Image to PDF Conversion).
2import os
3dir_path = "/home/nihalzown/Downloads"
4extentions =( ".jpg", ".jpeg", ".png", ".pdf")
5if not os.path.exists(dir_path):
6 print("Directory not found")
7else:
8 matched_files = [f for f in os.listdir(dir_path) if f.endswith(extentions)]
9 if matched_files:
10 print("Files found:")
11 for file in matched_files:
12 print(file)
13 else:
14 print("No files found")
15