I was looking for something and came across this:
subfolders = [ f.path for f in os.scandir(x) if f.is_dir() ]
I've never seen this type of conditional statement before.
What would you call this type of conditional statement to the right of the =
sign? Just asking so I know what to Google.
Also, if I wanted to write the equivalent in another format, would it look something like this?
subfolders = []
x = "c:\\Users\\my_account\\AppData\\Program\\Cache"
for f in os.scandir(x):
if f.isdir():
print(f.x)
Would both of those statements be equivalent?