EdX

Computing in Python II: Control Structures (edX)

Computing in Python II: Control Structures (edX)

Learn about control structures, one of the most powerful parts of programming. This course covers conditionals, loops, functions, and error handling, specifically in Python but with broader applicability to other languages as well. Building on your prior knowledge of variables and operators, this course gets into the meat of programming. Organized into five chapters, this course starts by covering the fundamentals of what control structures are and what they do, then moves on to four common control structures in Python.

Class Deals by MOOC List - Click here and see EdX's Active Discounts, Deals, and Promo Codes.

Conditionals let you modify what your program does based on the values of incoming variables. Loops let you repeat tasks for multiple values or while certain conditions hold true. Functions let you encapsulate complex reasoning into reusable chunks of code. Error handling lets you intelligently recover from anticipated and unanticipated glitches.
By the end of this course, you'll be able to write complex programs in Python that perform useful reasoning. For example, you could write a program that calculates your weight on other planets, calculates the standard deviation of a series of numbers, or checks for the validity of an incoming password.
Structurally, the course is comprised of several parts. Instruction is delivered via a series of short (2-3 minute) videos. In between those videos, you'll complete both multiple choice questions and coding problems to demonstrate your knowledge of the material that was just covered.
This course is part of the Introduction to Python Programming Professional Certificate.

What you'll learn

  • How control structures can affect how other lines of code run.
  • Conditionals, including if, else-if, and else, for complex reasoning.
  • Loops, including for loops, for-each loops, and while loops for repeated behaviors.
  • Functions, for encapsulating code into reusable chunks.
  • Error handling, for anticipating and resolving expected errors.

Syllabus

Chapter 1: Control Structures. The basic role of control structures in general: lines of code that control other lines of code, determining when they execute.
Chapter 2: Conditionals. Building complex reasoning into our code by letting it make decisions based on the changing values of variables, like recommending a raincoat if it's going to rain or issuing a passing grade if a student's average is over 70.
Chapter 3. Loops. Building even more complex reasoning with for loops and while loops, both of which repeat certain lines of code over and over for every value in a list or while some condition is true.
Chapter 4. Functions. Encapsulating blocks of code into reusable functions that can be called as needed, including specifying their input and dictating their output.
Chapter 5. Error Handling. Reacting gracefully when anticipated or unanticipated errors occur during your program's execution.

Go to Class
MOOC List is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

Related Courses

Introducción a la programación en C: Funciones y punteros (edX) EdX
Universidad Autonoma de Madrid

Introducción a la programación en C: Funciones y punteros (edX)

En este curso aprenderás cómo hacer programas modulares a través de funciones y punteros en el lenguaje de programación C, uno de los más utilizados. Este curso en línea te permitirá aprender más conceptos para ampliar tus habilidades de programación en el lenguaje C. Ahora resolveremos los problemas de forma modular, dividiendo el código en pequeñas partes definidas como funciones.

Self Paced
Self-Paced
Data Science and Machine Learning Capstone Project (edX) EdX
IBM

Data Science and Machine Learning Capstone Project (edX)

Create a project that you can use to showcase your Data Science skills to prospective employers. Apply various data science and machine learning techniques to analyze and visualize a data set involving a real life business scenario and build a predictive model. Now that you've taken several courses on data science and machine learning, it’s time to put your learning to work on a data problem involving a real life scenario. Employers really care about how well you can apply your knowledge and skills to solve real world problems, and the work you do in this capstone project will make you stand out in the job market.

Self Paced
Self-Paced
Visualizing Data with Python (edX) EdX
IBM

Visualizing Data with Python (edX)

Data visualization is the graphical representation of data in order to interactively and efficiently convey insights to clients, customers, and stakeholders in general. "A picture is worth a thousand words." We are all familiar with this expression. It especially applies when trying to explain the insights obtained from the analysis of increasingly large datasets. Data visualization plays an essential role in the representation of both small and large-scale data. One of the key skills of a data scientist is the ability to tell a compelling story, visualizing data and findings in an approachable and stimulating way.

Self Paced
Self-Paced
Java Programming Fundamentals (edX) EdX
Galileo University,GalileoX

Java Programming Fundamentals (edX)

Your career as a program developer starts here. Gain entry-level programing skills in Java language, and prepare yourself to handle any task that is required in any programming job. Java is one of the most in-demand programming languages today. This course is designed to provide students the basic skills and knowledge on Java.

Self Paced
Self-Paced
Probability and Statistics in Data Science using Python (edX) EdX
University of California, San Diego,UC San DiegoX

Probability and Statistics in Data Science using Python (edX)

Using Python, learn statistical and probabilistic approaches to understand and gain insights from data. The job of a data scientist is to glean knowledge from complex and noisy datasets. Reasoning about uncertainty is inherent in the analysis of noisy data. Probability and Statistics provide the mathematical foundation for such reasoning.

Self Paced
Self-Paced
Python Basics for Data Science (edX) EdX
IBM

Python Basics for Data Science (edX)

This Python course provides a beginner-friendly introduction to Python for Data Science. Practice through lab exercises, and you'll be ready to create your first Python scripts on your own! Kickstart your learning of Python for data science, as well as programming in general with this introduction to Python course. This beginner-friendly Python course will quickly take you from zero to programming in Python in a matter of hours and give you a taste of how to start working with data in Python.

Self Paced
Self-Paced
SQL for Data Science (edX) EdX
IBM

SQL for Data Science (edX)

Learn how to use and apply the powerful language of SQL to better communicate and extract data from databases - a must for anyone working in the data science field. Much of the world's data lives in databases. SQL (or Structured Query Language) is a powerful programming language that is used for communicating with and extracting various data types from databases.

Self Paced
Self-Paced
Computing in Python IV: Objects & Algorithms (edX) EdX
Georgia Institute of Technology,GTx

Computing in Python IV: Objects & Algorithms (edX)

Learn about recursion, search and sort algorithms, and object-oriented programming in Python. Complete your introductory knowledge of computer science with this final course on objects and algorithms. Now that you've learned about complex control structures and data structures, learn to develop programs that more intuitively leverage your natural understanding of problems through object-oriented programming. Then, learn to analyze the complexity and efficiency of these programs through algorithms. In addition, certify your broader knowledge of Introduction to Computing with a comprehensive exam.

Self Paced
Self-Paced
Statistics Using Python (edX) EdX
University of Wisconsin–Madison,WisconsinX

Statistics Using Python (edX)

Learn the fundamentals of statistics using Python. This course is a compact primer in statistics as a foundation for data-driven business analysis. A selection of concepts include descriptive statistics, probability, inference, correlation, and regression. The course also exposes students to basic Python programming for use in statistics.

Sep 2nd 2026
5-12 Weeks
Python: aprender a programar (edX) EdX
Universitat Politècnica de València,UPValenciaX

Python: aprender a programar (edX)

Aprende a programar con Python desde cero. Comienza conociendo variables, bucles y funciones y llega a manejar ficheros de texto. Este curso empieza desde 0 para aprender a programar con Python, tratando los fundamentos de programación como son las variables y constantes, las condiciones, los bucles y los módulos y funciones, para acabar introduciendo el tratamiento de cadenas de texto y los ficheros.

Self Paced
Self-Paced
CS50's Introduction to Artificial Intelligence with Python (edX) EdX
HarvardX,Harvard University

CS50's Introduction to Artificial Intelligence with Python (edX)

Learn to use machine learning in Python in this introductory course on artificial intelligence. AI is transforming how we live, work, and play. By enabling new technologies like self-driving cars and recommendation systems or improving old ones like medical diagnostics and search engines, the demand for expertise in AI and machine learning is growing rapidly. This course will enable you to take the first step toward solving important real-world problems and future-proofing your career.

Self Paced
Self-Paced