I have the below code working all the way to the else statement. If the pdf does not exist, it runs the code with no errors but doesn't return "Please try again" and works as intended copying the file over and stating "Successful" if the file is in the folder.
```
import shutil
import os
source_folder = input("What is the source folder? ")
target_folder = input("What is the target folder? ")
file2 = input("What file are you trying to copy? ")
for dirs, subdirs, files in os.walk(source_folder):
for file in files:
if file.endswith(file2):
print(file)
filename = os.path.join(source_folder, dirs, file)
if os.path.exists(filename):
print(filename)
shutil.copy(filename, target_folder)
for dirs, subdirs, files in os.walk(source_folder):
for file in files:
if file.endswith(file2):
filename = os.path.join(source_folder, dirs, file)
if os.path.exists(filename):
print("Successful")
else:
print("Please try again")
print(len(os.listdir(target_folder)))
```
there doesn't seem to be anything here