PYTHON CORE · LESSON 35
Write the file down.
with open and write · about 14 minutes
Learning with progressRead the summary for free. To save the work, log in to the account.
Type the code yourself
Reprint the file creation. The code here is checked by lines; to create a file on your computer, run it in VS Code.
with open("story.txt", "w", encoding="utf-8") as file:
file.write("Жил кот")Open the editor for class workSolve it yourself
Напиши код, который через with open создаёт note.txt в режиме w с encoding="utf-8" и записывает в него «Привет!». Назови переменную файла file.
The answer is hidden. Use similar examples from the lesson notes.
Opening up your homework