The user inputs a string signifying a folder name, then hardcoded file names are added onto that string from a list to create two absolute file paths.
The first file path is ok, but the second adds the filename onto the already added first filename.
files = ["file1.txt", "file2.txt"]
path = str(input("Path: "))
new_paths = []
for file in files:
path += r"\{0}".format(file)
new_paths.append(path)
print(new_paths)
Supposing an user input of:
C:\\Users\User\Desktop\file_folder
The file paths added onto the new_paths list are:
['C:\\\\Users\\Users\\Desktop\\file_folder\\file1.txt', 'C:\\\\Users\\Users\\Desktop\\file_folder\\file1.txt\\file2.txt']
As opposed to the desired result of:
['C:\\\\Users\\Users\\Desktop\\file_folder\\file1.txt', 'C:\\\\Users\\Users\\Desktop\\file_folder\\file2.txt']