Institute of Computer Science
  1. Courses
  2. 2025/26 fall
  3. Introduction to Programming (MTAT.03.236)
ET
Log in

Introduction to Programming 2025/26 fall

  • Home Page
  • Introduction
  • Expressions
  • Conditional Execution
  • Functions
  • Iterations
  • Strings
  • Files
  • Lists
  • Graphics?
< eelmineTable of Contentsnext >

7.1 WHAT IS A FILE?

Files are used to store data persistently. This means the information in files remains available even after the program that created or modified them has finished running or the computer has been turned off. Files allow us to save our work, share data, and communicate between different programs and systems.

On a high level, we can categorize files into two types - text files and binary files. Text files contain data that is in a human-readable format. They can be opened and edited with a text editor, such as a notepad or a code editor. Examples would be text files .txt and python scripts .py.

Binary files contain data in a format that is not intended to be directly readable by humans. This includes images (.jpg, .png) and executable files (.exe on Windows), to name a few. While you can open a binary file in a text editor, the content will appear as a garbled mess of characters because it represents encoded data that only specific software can correctly interpret.

KEY THINGS TO REMEMBER

  • Files are used to store data persistently, meaning the information remains available even after the program ends or the computer is turned off.
  • Text files contain data in a human-readable format, such as .txt and .py. They can be edited using text editors, such as Notepad.
  • Binary files contain data that is not in a human-readable format, examples include images .jpg and executable files .exe.
< eelmineTable of Contentsnext >

  • Institute of Computer Science
  • Faculty of Science and Technology
  • University of Tartu
In case of technical problems or questions write to:

Contact the course organizers with the organizational and course content questions.
The proprietary copyrights of educational materials belong to the University of Tartu. The use of educational materials is permitted for the purposes and under the conditions provided for in the copyright law for the free use of a work. When using educational materials, the user is obligated to give credit to the author of the educational materials.
The use of educational materials for other purposes is allowed only with the prior written consent of the University of Tartu.
Terms of use for the Courses environment