Please enable JavaScript to use CodeHS

Utah Introduction to Python 1 and 2

File I/O: Reading from Files

Students learn how to open and read files in their programs in various ways.

Lessons

16.1 What is File I/O

  • What is File I/O
  • What is File I/O
  • What is a TXT File?
  • What is a CSV File?
  • Choosing a File Format: TXT vs. CSV
  • +3 more

16.2 Reading Characters from File

  • Reading Characters from File
  • Reading Characters from File
  • Reading Characters from File: Example Walkthrough
  • Read All Characters
  • Read Specific Characters
  • +2 more

16.3 Reading Line from File

  • Reading Line from File
  • Reading Line from File
  • Reading Line from File: Example Walkthrough
  • Reading and Printing Lines
  • Turtle Path
  • +1 more

16.4 Reading All Lines from File

  • Reading All Lines from File
  • Reading All Lines from File
  • Reading All Lines from File: Example Walkthrough
  • Using readlines()
  • ASCII Art
  • +4 more

16.5 File I/O: Reading from Files Quiz

  • File I/O: Reading from Files Quiz