Log in from a computer to take this course

You'll need to log in from a computer to start Learn Python 3. But you can practice or keep up your coding streak with the Codecademy Go app. Download the app to get started.

apple storegoogle store

Now you know all about files! You were able to:

  • Open up file objects using open() and with.
  • Read a file’s full contents using Python’s .read() method.
  • Read a file line-by-line using .readline() and .readlines()
  • Create new files by opening them in write-mode.
  • Append to a file non-destructively by opening a file in append-mode.
  • Apply all of the above to different types of data-carrying files including CSV and JSON!

You have all the skills necessary to read, write, and update files programmatically, a very useful skill in the Python universe!

Sign up to start coding

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?