Vai al contenuto principale
๐Ÿ”’ Modalitร  anteprima. Le prime quindici lezioni di Foundations sono gratuite; questa รจ Pro. Avvia un trial di 7 giorni per sbloccare l'editor, i suggerimenti AI e il resto del programma. Carta richiesta, disdici in qualsiasi momento dalla Dashboard.Avvia trial di 7 giorni โ†’
โšก
โ† Corsiโ€บPython FoundationsModulo 8 ยท Python moderno e capstoneโ€บpathlib: gestione moderna dei percorsipredict163 / 174
+100 XP
Compito๐ŸŒ 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.
Predici output

Leggi il codice attentamente

from pathlib import Path

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

Cosa stamperร  il programma? Scrivi qui: