- Level Foundation
- Duration 31 hours
- Course by University of Michigan
-
Offered by
About
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. The course is well-suited for you if you have already taken the "Python Basics" course and want to gain further fundamental knowledge of the Python language. Together, both courses are geared towards newcomers to Python programming, those who need a refresher on Python basics, or those who may have had some exposure to Python programming but want a more in-depth exposition and vocabulary for describing and reasoning about programs. This is a follow-up to the "Python Basics" course (course 1 of the Python 3 Programming Specialization), and it is the second of five courses in the specialization.Modules
Welcome to Python Functions, Files, and Dictionaries!
2
Labs
- (Optional) Getting Started with Jupyter Notebooks
- Optional Lab - Testing with Assert
5
Videos
- Introduction to the Specialization
- What’s New? Updates and Improvements in the Second Edition
- Welcome to Python Functions, Files, and Dictionaries
- How to Use the Interactive Textbook
- Executing Python in the Jupyter Environment
3
Readings
- Syllabus
- A note on assert
- Help Us Learn More About You!
Files
9
External Tool
- Use the Runestone Practice Tool
- 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
6
Videos
- Introduction: Files
- Reading a File
- Finding a File in Your File System
- Writing to a File
- Using With to Open Files
- Conclusion: Files
CSV Output
- Assessment - Files and CSV
4
External Tool
- CSV Format
- Reading a .csv File
- Writing Data to a .csv File
- Tips on Handling Files
1
Labs
- Optional Lab - Reading and Writing Files
9
Videos
- Introduction: .csv Format
- Reading a .csv File
- Writing Data to a .csv File
- Reading from Files with the csv Module
- Writing to Files with the csv Module
- Tips on File Naming
- Conclusion: .csv Format
- How to Submit Assessments
- Recovering from corrupted assignment notebooks
Dictionary Mechanics
- Assessment - Dictionary Mechanics
6
External Tool
- Use the Runestone Practice Tool
- Introduction: Dictionary Learning Goals
- Introduction: Dictionaries
- Dictionary Operations
- Dictionary Methods
- Aliasing and Copying
8
Videos
- Introduction: Dictionary Mechanics
- Dictionaries
- Demonstration: Dictionary Basics
- Dictionary Operations
- Dictionary Methods
- Demonstration: Dictionary Methods
- Aliasing and Copying with Dictionaries
- Conclusion: Dictionary Mechanics
Dictionary Accumulation
- Assessment - Dictionary Accumulation
4
External Tool
- Introduction: Accumulating Multiple Results in a Dictionary
- Accumulating Results From a Dictionary
- Accumulating the Best Key
- When to Use a Dictionary
1
Labs
- Optional Lab - Dictionaries
7
Videos
- Introduction: Dictionary Accumulation
- Dictionary Accumulation
- Demonstration: Dictionary Accumulation
- Accumulating Results From a Dictionary
- Accumulating the Best Key
- csv Module with Dictionaries
- Conclusion: Dictionary Accumulation
Function Basics
8
External Tool
- Interactive Textbook Practice Opportunity
- Introduction to Functions
- Function Definition
- Function Invocation
- Function Parameters
- Returning a Value from a Function
- Decoding a Function
- A Function that Accumulates
8
Videos
- Introduction: Functions
- Defining Functions
- Positional Parameter Passing
- Returning Values
- Way of the Programmer: Decoding a Function
- A Function that Accumulates
- Type Hinting
- Conclusion: Functions
Local and Global Variables, and Side Effects
- Assessment - Functions
8
External Tool
- Local Variables
- Global Variables
- Function Composition
- Flow of Execution Summary
- Print vs. Return
- Passing Mutable Objects
- Side Effects
- Writing Test Cases for Functions
1
Labs
- Optional Lab - Defining Functions
7
Videos
- Introduction: Variable Scoping and Side Effects
- Local and Global Variables
- Function Composition
- Mutable Objects and Side Effects
- Test Cases for Functions
- Way of the Programmer: Enforcing Variable Typing for Function Parameters
- Conclusion: Variable Scoping and Side Effects
Tuples
- Assessment - Tuples
5
External Tool
- Introduction
- Tuple Packing
- Tuples as Return Values
- Tuple Assignment with Unpacking
- Unpacking Tuples as Arguments to Function Calls
1
Labs
- Optional Lab - Tuple Packing and Unpacking
4
Videos
- Introduction: Tuple Packing and Unpacking
- Tuple Packing
- Tuple Assignment with Unpacking
- Conclusion: Tuple Packing and Unpacking
While Loop
- Assessment - More About Iteration
7
External Tool
- Interactive Textbook Practice Opportunity
- Introduction
- The While Statement
- The Listener Loop
- Randomly Walking Turtles
- Break and Continue
- Infinite Loops
1
Labs
- Optional Lab - While Loops, Break and Continue
6
Videos
- Introduction: While Loop
- The While Statement
- The Listener Loop
- Break and Continue
- Way of the Programmer: Infinite Loops
- Conclusion: While Loop
Advanced Functions
- Assessment - Advanced Functions
6
External Tool
- Introduction: Optional Parameters
- Keyword Parameters
- Testing Optional Parameters
- Test-driven Program Development
- Anonymous Function with Lambda Expressions
- Programming With Style
2
Labs
- Optional Lab - Optional and Keyword Parameters
- Optional Lab - Testing Functions, Lambda Expressions
8
Videos
- Introduction: Advanced Functions
- Introduction: Optional Parameters
- Mutation and Optional Parameters
- Keyword Parameters
- Testing Optional Parameters
- Test-Driven Program Development
- Anonymous Functions with Lambda Expressions
- Conclusion: Advanced Functions
Sorting Basics
4
External Tool
- Interactive Textbook Practice Opportunity
- Introduction: Sorting with Sort and Sorted
- Optional Reverse Parameter
- Optional Key Parameter
5
Videos
- Introduction: Sorting Basics
- Invoking .Sort and Sorted
- Optional Reverse Parameter
- Optional Key Parameter
- Conclusion - Sorting Basics
1
Readings
- Sorting Demonstration with Folk Dancers
Sorting Dictionaries, Breaking Ties
- Assessment - Sorting
3
External Tool
- Sorting a Dictionary's Keys
- Breaking Ties
- When to Use Lambda vs. Function
1
Labs
- Optional Lab - Sorting
5
Videos
- Introduction: Advanced Sorting
- Sorting a Dictionary's Keys
- Breaking Ties
- Way of the Programmer: When to Use a Lambda Expression
- Conclusion: Advanced Sorting
Way of the Programmer
5
Videos
- Introduction: Running Python Elsewhere
- Installing Python and VS Code Locally on Windows
- Installing Python and VS Code Locally on Mac
- Using VS Code
- Running Python in the Cloud
Python Functions, Files, and Dictionaries - Final Course Project
- Project - Part 1: Sentiment Classifier
1
Peer Review
- Project - Part 2: Sentiment Analysis
1
Videos
- Introduction - Final Course Project
Course Feedback
2
Readings
- Course Feedback
- Keep Learning with Michigan Online
Auto Summary
Explore the "Python Functions, Files, and Dictionaries" course, an IT & Computer Science offering on Coursera. Led by expert instructors, this foundational course dives into dictionary data structures, user-defined functions, local/global variables, parameter-passing, and lambda expressions. You'll also master Python's sorted function and apply your skills in a final project analyzing social media data. Ideal for those who've completed "Python Basics," this course is perfect for newcomers or those seeking a deeper understanding of Python. Duration: 1860 minutes, available with a Starter subscription.

Paul Resnick

Steve Oney