Python Functions, Files, and Dictionaries

  • 4.8
Approx. 31 hours to complete

Course Summary

Learn how to create Python functions, manipulate files, and work with dictionaries in this hands-on course. Build upon your foundational Python skills and gain practical experience with real-world exercises.

Key Learning Points

  • Learn how to create and use functions in Python
  • Master file input/output operations
  • Get hands-on experience working with dictionaries

Related Topics for further study


Learning Outcomes

  • Create and use functions in Python
  • Manipulate files using Python
  • Work with dictionaries to store and manipulate data

Prerequisites or good to have knowledge before taking this course

  • Basic knowledge of Python programming
  • Access to a computer with Python installed

Course Difficulty Level

Intermediate

Course Format

  • Online self-paced course
  • Hands-on exercises and quizzes

Similar Courses

  • Python Data Structures
  • Python Basics
  • Python for Everybody

Related Education Paths


Notable People in This Field

  • Creator of Python
  • Data science instructor

Related Books

Description

This course introduces the dictionary data structure and user-defined functions. You’ll learn about local and global variables, optional and keyword parameter-passing, named functions and lambda expressions. You’ll also learn about Python’s sorted function and how to control the order in which it sorts by passing in another function as an input. For your final project, you’ll read in simulated social media data from a file, compute sentiment scores, and write out .csv files. It covers chapters 10-16 of the textbook “Fundamentals of Python Programming,” which is the accompanying text (optional and free) for this course.

Outline

  • Files and CSV Output
  • Introduction to the Specialization
  • Welcome to Python Functions, Files, and Dictionaries
  • How to Use the Interactive Textbook
  • Introduction: Files
  • Reading a File
  • Finding a File in Your File System
  • Writing to a File
  • Using With to Open Files
  • Conclusion: Files
  • Introduction: .csv Format
  • Reading a .csv File
  • Writing Data to a .csv File
  • Tips on File Naming
  • Conclusion: .csv Format
  • Syllabus
  • Help Us Learn More About You!
  • Introduction: Working with Data Files
  • Reading a File
  • Alternative File Reading Methods
  • Iterating Over Lines in a File
  • Finding a File in your File System
  • Writing to a File
  • Using With to Open Files
  • Recipe for Reading and Processing a File
  • CSV Format
  • Reading a .csv File
  • Writing Data to a .csv File
  • Tips on Handling Files
  • Optional - What Did You Use to Practice This Week?
  • Dictionaries and Dictionary Accumulation
  • Dictionaries
  • Demonstration: Dictionary Basics
  • Dictionary Operations
  • Dictionary Methods
  • Demonstration: Dictionary Methods
  • Aliasing and Copying with Dictionaries
  • Dictionary Accumulation
  • Demonstration: Dictionary Accumulation
  • Accumulating Results From a Dictionary
  • Demonstration: Accumulating Results From a Dictionary
  • Introduction: Dictionary Learning Goals
  • Introduction: Dictionaries
  • Dictionary Operations
  • Dictionary Methods
  • Aliasing and Copying
  • Introduction: Accumulating Multiple Results in a Dictionary
  • Accumulating Results From a Dictionary
  • Accumulating the Best Key
  • When to Use a Dictionary
  • Optional - What Did You Use to Practice This Week?
  • Functions and Tuples
  • Introduction: Functions
  • Defining Functions
  • Positional Parameter Passing
  • Returning Values
  • Way of the Programmer: Decoding a Function
  • A Function that Accumulates
  • Conclusion: Functions
  • Introduction: Variable Scoping and Side Effects
  • Local and Global Variables
  • Function Composition
  • Mutable Objects and Side Effects
  • Conclusion: Variable Scoping and Side Effects
  • Introduction: Tuple Packing and Unpacking
  • Tuple Packing
  • Tuple Assignment with Unpacking
  • Conclusion: Tuple Packing and Unpacking
  • Introduction to Functions
  • Function Definition
  • Function Invocation
  • Function Parameters
  • Returning a Value from a Function
  • Decoding a Function
  • A Function that Accumulates
  • Local Variables
  • Global Variables
  • Function Composition
  • Flow of Execution Summary
  • Print vs. Return
  • Passing Mutable Objects
  • Side Effects
  • Introduction
  • Tuple Packing
  • Tuples as Return Values
  • Tuple Assignment with Unpacking
  • Unpacking Into Iterator Variables
  • Optional - What Did You Use to Practice This Week?
  • More Iteration and Advanced Functions
  • The While Statement
  • The Listener Loop
  • Break and Continue
  • Way of the Programmer: Infinite Loops
  • Optional Parameters
  • Keyword Parameters
  • Anonymous Functions with Lambda Expressions
  • Introduction
  • The While Statement
  • The Listener Loop
  • Randomly Walking Turtles
  • Break and Continue
  • Infinite Loops
  • Introduction: Optional Parameters
  • Keyword Parameters
  • Anonymous Function with Lambda Expressions
  • Programming With Style
  • Optional - What Did You Use to Practice This Week?
  • Sorting
  • Introduction: Sorting Basics
  • Invoking .Sort and Sorted
  • Optional Reverse Parameter
  • Optional Key Parameter
  • Conclusion - Sorting Basics
  • Introduction: Advanced Sorting
  • Sorting a Dictionary's Keys
  • Breaking Ties
  • Way of the Programmer: When to Use a Lambda Expression
  • Conclusion: Advanced Sorting
  • Introduction - Final Course Project
  • Introduction: Sorting with Sort and Sorted
  • Optional Reverse Parameter
  • Optional Key Parameter
  • Sorting a Dictionary's Keys
  • Breaking Ties
  • When to Use Lambda vs. Function
  • Course Feedback
  • Keep Learning with Michigan Online

Summary of User Reviews

Find out what users are saying about the Python Functions, Files, and Dictionaries course on Coursera. This course has received high praise from students for its comprehensive introduction to Python programming concepts. Many users appreciate the interactive nature of the course, which allows for hands-on learning and immediate feedback.

Key Aspect Users Liked About This Course

The course provides a strong foundation in Python programming and is suitable for beginners.

Pros from User Reviews

  • Interactive exercises allow for hands-on learning and immediate feedback
  • Comprehensive introduction to Python programming concepts
  • Suitable for beginners
  • Great for building a foundation in Python programming
  • Engaging and well-structured course material

Cons from User Reviews

  • Some users find the course material too basic
  • Course could benefit from more advanced topics
  • Some exercises can be repetitive
  • Lack of real-world application examples
  • Not suitable for experienced Python programmers
English
Available now
Approx. 31 hours to complete
Paul Resnick, Steve Oney, Jaclyn Cohen
University of Michigan
Coursera

Instructor

Paul Resnick

  • 4.8 Raiting
Share
Saved Course list
Cancel
Get Course Update
Computer Courses