I'm tying to delete a file using this code and I am getting "YES File is present" but on os.remove I am getting error.
Code
os.chdir('C:/Users/USERNAME/Desktop/WhatsApp Documents/7K1')
if os.path.exists("file.jpg"):
print('YES File is Present')
os.remove('file.jpg')
else:
print('NO')
Error
PermissionError: [WinError 5] Access is denied: 'file.jpg'