Syntax and Usage

Now that you're familiar with file input and output, read this for more on syntax and usage.

Files: Writing to Files

In-class activity 2

Modify the program we just did (see file workWithFiles6.py) to output the squares of the first n positive integers into it, separated by new line character ('\n'), i.e. one value per line.


out.txt

1

4

9

16

25

36