Naar hoofdinhoud
🔒 Voorbeeldmodus. De eerste vijftien Foundations-lessen zijn gratis; deze is Pro. Start een 7-daagse trial om de editor, AI-hints en de rest van het curriculum te ontgrendelen. Kaart vereist, op elk moment opzegbaar in Dashboard.Start 7-daagse trial →
⚡
← Cursussen›Python FoundationsModule 8 · Moderne Python en sluitsteen›

pathlib — moderne padafhandeling

predict163 / 174
+100 XP
Opdracht🌐 shown in EN
📝 **Question:** Predict the two lines printed. \`.name\` returns the final segment ("today.log"); \`.suffix\` returns the extension with the dot. 📋 Pick the right answer. 💡 **Hint:** Re-read the theory above if unsure.
Voorspel uitvoer

Lees de code zorgvuldig

from pathlib import Path

p = Path("data") / "logs" / "today.log"
print(p.name)
print(p.suffix)

Wat zal het programma uitprinten? Schrijf hier: