Mark As Completed Discussion

Python provides an in-built function open() which opens the file inside the program. You need to specify the name of the file which needs to be opened in a string within the parenthesis. By default, the file opens in reading mode. You can specify different modes according to how you want to use the file in your program.

If you want to write to a file, you'd do something like this.

JAVASCRIPT
OUTPUT
:001 > Cmd/Ctrl-Enter to run, Cmd/Ctrl-/ to comment