Writing to Files in Python 1



Interactive tasks (trinket.io)

Each task below is interactive. Edit the code in the editor and click Run.

Task 1 — Write a program that writes a line of text to a file

Task 2 —Write a program that writes several lines of text to a file