Category: Data

So far in this introductory series to the https://www.python.org/, we’ve learned some pretty cool basic Python tricks. We’ve learned https://thenewstack.io/an-introduction-to-python-for-non-programmers/, learned about the https://thenewstack.io/more-python-for-non-programmers/, and learned how to accept input from users.

The first thing we add to the file is the line to indicate we’re opening the text.txt file in write-only mode.

What we’ve done here is define the variable file1 with the function that opens the text.txt file in write mode.

If you view the contents of the text.txt file, you’ll see it contains the Hello, New Stack line at the top.

Related Articles