Locked learning resources

Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Locked learning resources

This lesson is for members only. Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Accessing Files and Folders (Review Exercises)

Avatar image for brianmcquaig

brianmcquaig on Dec. 24, 2023

Shouldn’t exercise #3 read (change in caps)?:

Print the name of the FILE assigned to file_path. The output should be ‘my_file.txt’.

Avatar image for Martin Breuss

Martin Breuss RP Team on Jan. 3, 2024

@brianmcquaig hm, my first intuition was to say that it should keep saying path—as it currently.

Probably because I want to highlight that the Path object is only that—a Path object—and not a file.

But I see that the task is just to print the file name part of the path, so maybe a better way to describe this would be:

Print the file name of the path assigned to file_path. The output should be 'my_file.txt'.

What do you think about that? Does that make it more clear?

Become a Member to join the conversation.