π 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 FoundationsβΊModule 8 Β· Moderne Python en sluitsteenβΊpathlib β moderne padafhandelingpredict163 / 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)