Changing The Working Directory

Mon 10 August 2026
import os

os.chdir("C:/Projects")
print(os.getcwd())
---------------------------------------------------------------------------

FileNotFoundError                         Traceback (most recent call last)

Cell In[1], line 3
      1 import os
----> 3 os.chdir("C:/Projects")
      4 print(os.getcwd())


FileNotFoundError: [WinError 2] The system cannot find the file specified: 'C:/Projects'


Score: 10

Category: chapter12_file_handling