I was taking the fast.ai course and came across this snippet of code (in Python 3):
PATH = "data/dogscats/"
os.listdir(f'{PATH}valid')
This returns the list of the files in the directory data/dogscats/valid
, like I expected. However, I don't understand what purpose the "f" in front of '{PATH}valid'
serves. When removed, the code throws a "FileNotFound" error. Why is the "f" there? It's not even part of the string? I know this might be an elementary question, but it's something I'd love to understand.
Thank you in advance!