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 percorsi

predict163 / 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: