+ 1

Help me please!!!!

8. Write a function that changes the extension in the file name to the specified one (for example, on '.bak'). The function takes two parameters: the file name and the extension. Mind you that in the original name the extension may be empty.

1st Apr 2019, 3:20 PM
Ekaterina Kadulina
Ekaterina Kadulina - avatar
1 Answer
0
If you just want to change the extension you can use the os.splittext method and split it at the dot. After that you save each part in two variables and then just save as var1 + your wished extension
1st Apr 2019, 9:32 PM
gabrijel2503