🔒 Modo vista previa. Las primeras quince lecciones de Foundations son gratis; esta es Pro. Inicia un trial de 7 días para desbloquear el editor, las pistas AI y el resto del programa. Tarjeta requerida, cancela cuando quieras en Dashboard.Iniciar trial de 7 días →
← Cursos›Creative Challenges›Módulo 3 · 🕰️ Refactor de viaje en el tiempo (10)›⏰ 2008 → 2026: abrir/leer/cerrar → pathlib.read_textpredict25 / 104
+125 XP
Tarea🌐 shown in EN
Predict what the modernized pathlib version prints. `path.write_text` stores the string, `path.read_text` retrieves it, `len` is 15 for 'Hello from 1998'.
Predice la salida
Lee el código con atención
from pathlib import Path
path = Path("greeting.txt")
path.write_text("Hello from 1998")
text = path.read_text()
print(text)
print("length:", len(text))
path.unlink()
¿Qué imprimirá el programa? Escribe aquí:
💬 Discusión
Sé el primero en hacer una pregunta o compartir un consejo.
Inicia sesión para unirte a la discusión. Leer es gratis.