if [1]:
    print("Then")
else:
    print("Else")
for x in [1]:
    print("Then")
else:
    print("Else")
import shutil
# Both with or without the file extension works.
shutil.copy2('/dir/file.ext', '/new/dir/newname.ext')
shutil.copy2('/dir/file.ext', '/new/dir')
import shutil
shutil.move("old.txt", "new.md")
if not os.path.exists(directory): # Check first if the folder is exists.
    os.makedirs(directory)
  • The directory could be just the name of the directory/folder you want to make or an absolute path.
    • The first is means that the folder will be made in the directory of which the Python script runs.
    • The latter is to create directory/folder in any other location within your computer.