Real Python
  • Start Here
  • Learn Python
    Start Learning
    Your Learning Plan →Your personalized Python learning plan Python Tutorials →In-depth articles and video courses Learning Paths →Guided study plans for accelerated learning
    Practice
    Quizzes & Exercises →Check your learning progress Browse Topics →Focus on a specific area or skill level Reference →Concise definitions for common Python terms
    Get Help
    Code Mentor →BetaPersonalized code assistance & learning tools Office Hours →Live Q&A calls with Python experts Community Chat →Learn with other Pythonistas
    Go Deeper
    Live Courses →Live, instructor-led Python courses Books →Round out your knowledge and learn offline Podcast →Hear what’s new in the world of Python
    Unlock All Content and Become a Python Expert →Get unlimited access to all Real Python has to offer
    Unlock All Content →Become a Python Expert
  • More
    Learner Stories Python Newsletter Python Job Board Meet the Team Become a Contributor
  • Search
/
  • Join
  • Sign‑In

Python Basics: Reading and Writing Files (Quiz)

Bartosz Zaczyński
Python Basics: Reading and Writing Files Bartosz Zaczyński 04:00
Course Slides (PDF) Sample Code (ZIP) Ask a Question
  • Contents
  • Discussion

Loading Quiz...

Become a Member to join the conversation.

Course Contents

Overview
83%
  • Getting to Know Files in Python
  • Python Basics: Reading and Writing Files (Overview) 04:04
    Opening and Closing Files 10:21
    Understanding Text and Binary Files 07:18
    Specifying the Character Encoding 09:46
    Choosing the Line Ending 07:42
    Exploring the Different File Modes 03:33
  • Reading and Writing Text Files in Python
  • Writing Text to a File 03:53
    Retrieving Text From a File 02:46
    Exercise: Read a Text File 08:00
    Working With Multiline Files 05:08
    Exercise: Count Lines in a File 08:00
    Recapping Text File Operations 02:59
    Exercise: Write Lines to a File 08:00
    Reading and Writing CSV Data 10:33
    Exercise: Total CSV Expenses 08:00
  • Reviewing What You've Learned
  • Python Basics: Reading and Writing Files (Quiz) 04:00
    Python Basics: Reading and Writing Files (Summary) 02:48

© 2012–2026 Real Python ⋅ Privacy Policy