8000 Add missing colon to slice · madamak/python-basics-exercises@209af99 · GitHub
[go: up one dir, main page]

Skip to content

Commit 209af99

Browse files
committed
Add missing colon to slice
1 parent 35f178a commit 209af99

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ch11-file-input-and-output/2-working-with-paths-in-python.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
for file_name in file_names:
3434
file_path = os.path.join(current_folder, file_name)
3535
if file_path.lower().endswith(".png"):
36-
new_path = file_path[-4] + "_backup.png"
36+
new_path = file_path[:-4] + "_backup.png"
3737
os.rename(file_path, new_path)
3838

3939

0 commit comments

Comments
 (0)
0