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

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
CS50's Introduction to Programming with Python (edX) EdX
HarvardX,Harvard University

CS50's Introduction to Programming with Python (edX)

An introduction to programming using Python, a popular language for general-purpose programming, data science, web programming, and more. An introduction to programming using a language called Python. Learn how to read and write code as well as how to test and "debug" it. Designed for students with and without prior programming experience who'd like to learn Python specifically.

Self Paced
Self-Paced
Laboratorio di Programmazione (edX) EdX
University of Naples Federico II,FedericaX

Laboratorio di Programmazione (edX)

Impara a risolvere problemi complessi attraverso l'uso del computer e avvicinati alla magia degli algoritmi. Il linguaggio di programmazione è uno degli strumenti che abbiamo per interpretare e risolvere i problemi di tutti i giorni. Un linguaggio che è alla base di problemi comuni, come le previsioni del tempo o l'analisi della deformazione di una struttura di un'auto in un incidente stradale.

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
Computing for Data Analysis (edX) EdX
Georgia Institute of Technology,GTx

Computing for Data Analysis (edX)

A hands-on introduction to basic programming principles and practice relevant to modern data analysis, data mining, and machine learning. The modern data analysis pipeline involves collection, preprocessing, storage, analysis, and interactive visualization of data. In the course, you’ll see how computing and mathematics come together.

Aug 24th 2026
13-24 Weeks
Programación para todos (empezando con Python) (edX) EdX
University of Michigan,MichiganX

Programación para todos (empezando con Python) (edX)

Este curso en línea es una introducción "sin prerrequisitos" a la programación en Python. Aprenderás sobre las variables, la ejecución condicional, la ejecución repetida y cómo usamos las funciones. Este curso de Python tiene el objetivo de enseñar a todos lo básico de la programación de computadoras usando Python. Conocerás cómo construir un programa de una serie de instrucciones simples en Python.

Self Paced
Self-Paced
Introducción al desarrollo de aplicaciones web (edX) EdX
Universidad Autonoma de Madrid

Introducción al desarrollo de aplicaciones web (edX)

Aprende a desarrollar una aplicación web desde cero con diferentes tecnologías como HTML, CSS, Python, JSON, JavaScript y Ajax. Hoy en día utilizamos la web para todo tipo de tareas: buscar un vuelo, comprar entradas, ver el pronóstico meteorológico, leer noticias, etc. Todo esto es posible gracias a las aplicaciones web creadas para darnos estos servicios.

Self Paced
Self-Paced