Back

Python File Handling Practice / 1. Write to File

00:00
1/20

1. Write to File

Easy

Write a program that creates a file called 'output.txt' and writes "Hello, File!" to it.

  • 1

    Use open() with mode 'w' for writing. Don't forget to close the file or use 'with' statement.

PYTHON PLAYGROUND
PYTHON PLAYGROUND
⏳ Loading editor…