- Learn how to repeat actions in Python using for and while loops, and control loop execution with break and continue.
After completing this module, you're able to:
- Repeat actions a set number of times using a for loop.
- Repeat actions while a condition is True using a while loop.
- Control loop execution using break and continue.
- Store and iterate over multiple values using lists.
- Learn how to organize related data in Python using lists and dictionaries, and choose the right structure for the job.
After completing this module, you're able to:
- Store and manage ordered data using lists.
- Store and organize labeled data using dictionaries.
- Choose the right collection type for the data you're working with.
- Learn how to read from and write to files in Python using context managers to keep your code safe and clean.
After completing this module, you're able to:
- Open files safely using context managers.
- Read data from text files.
- Write and append data to text files.
- Learn how to write reusable code in Python using functions, parameters, return values, variable scope, and importable modules.
After completing this module, you're able to:
- Create functions that accept parameters.
- Return values from functions.
- Understand how variable scope affects your code.
- Split code across importable modules.
Overview
Google, IBM & Meta Certificates – 40% Off
One Coursera Plus subscription covers most Professional Certificates on Coursera.
Unlock All Certificates
Syllabus
- Repeat actions with loops
- Introduction
- Choose between for and while loops
- Controlling loop execution with break and continue
- Exercise - Create a guess the number game
- Module assessment
- Summary
- Organize data with collections
- Introduction
- Store and manage data with lists
- Store and organize data with dictionaries
- Exercise - Create a customer order
- Module assessment
- Summary
- Read and write files
- Introduction
- Open files safely with context managers
- Read data from files
- Write data to files
- Exercise - Build a to-do list
- Module assessment
- Summary
- Write reusable code
- Introduction
- Create functions with parameters
- Return values from functions
- Manage variable scope
- Create importable modules
- Exercise - Create a calculator
- Module assessment
- Summary