🔒 Mod previzualizare. Primele cincisprezece lecții Foundations sunt gratuite; aceasta este Pro. Pornește un trial de 7 zile pentru a debloca editorul, sugestiile AI și restul programului. Card necesar, anulează oricând în Dashboard.Pornește trial de 7 zile →
← Cursuri›Python Foundations›Modulul 8 · Python modern și capstone›pathlib — gestionarea modernă a căilorpredict163 / 174
+100 XP
Sarcină🌐 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.
Prezice ieșirea
Citește codul cu atenție
from pathlib import Path
p = Path("data") / "logs" / "today.log"
print(p.name)
print(p.suffix)