
"In this quiz, you'll revisit how to tame the file system with Python's pathlib module. You'll reinforce core pathlib concepts, including checking whether a path points to a file and instantiating Path objects. You'll revisit joining paths with the / operator and .joinpath(), iterating over directory contents with .iterdir(), and renaming files on disk with .replace(). You'll also check your knowledge of common file operations such as creating empty files with .touch(), writing text with .write_text(), and extracting filename components using .stem and .suffix."
"You'll also check your knowledge of common file operations such as creating empty files with .touch(), writing text with .write_text(), and extracting filename components using .stem and .suffix. The quiz contains 9 questions and there is no time limit. You'll get 1 point for each correct answer. At the end of the quiz, you'll receive a total score. The maximum score is 100%. Good luck!"
Nine questions reinforce practical use of Python's pathlib module for filesystem tasks. Core topics include creating and instantiating Path objects, checking whether paths point to files, and joining paths using the / operator and .joinpath(). Directory iteration with .iterdir() and renaming with .replace() appear as key operations. Common file operations covered include creating empty files with .touch(), writing text with .write_text(), and extracting filename parts via .stem and .suffix. The activity is untimed, awards one point per correct answer, and reports a final percentage score out of 100.
Read at Realpython
Unable to calculate read time
Collection
[
|
...
]