Aller au contenu principal
🔒 Mode aperçu. Les quinze premières leçons Foundations sont gratuites ; celle-ci est Pro. Démarrez un trial de 7 jours pour débloquer l'éditeur, les conseils AI et le reste du programme. Carte requise, annulez à tout moment dans Dashboard.Démarrer le trial de 7 jours →
← CoursPython FoundationsModule 8 · Python moderne et synthèsepathlib — gestion moderne des cheminspredict163 / 174
+100 XP
Tâche🌐 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.
Prédis la sortie

Lis le code attentivement

from pathlib import Path

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

Que va afficher le programme ? Écris ici :