skip to Main Content

How to solve "TypeError: list indices must be integers or slices, not str" – Artificial Intelligence

I have 2 files to copy from a folder to another folder and these are my codes: import shutil src = '/Users/cadellteng/Desktop/Program Booklet/' dst = '/Users/cadellteng/Desktop/Python/' file = ['AI+Product+Manager+Nanodegree+Program+Syllabus.pdf','Artificial+Intelligence+with+Python+Nanodegree+Syllabus+9-5.pdf'] for i in file: shutil.copyfile(src+file[i], dst+file[i]) When I tried to run…

VIEW QUESTION
Back To Top
Search