Accessing Files and Folders (Review Exercises)
The output here should be, again, a string,
'my_folder'. As a bonus, you can also see if you remember how you can pick apart the filename
my_file.txt and just print out the stem and the file suffix separately.
Do these exercises locally on your computer to get a bit of practice using
pathlib and to solidify the different methods and attributes on
Path objects that you’ve heard about in this section of the course.
Become a Member to join the conversation.