Python - File Handling Fundamentals
What will be the output of this code?
from pathlib import Path
p = Path('folder') / 'subfolder' / 'file.txt'
print(p.parts)from pathlib import Path
p = Path('folder') / 'subfolder' / 'file.txt'
print(p.parts)parts attribute returns a tuple of each part of the path as separate strings.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions