e-learning

Python - Flow Control

Abstract

"Flow Control" is how we describe when we change the flow of code's execution, based on some conditions. Here we'll learn how to take different actions depending on what data out program sees, or how to run code only if some condition is true.

About This Material

This is a Hands-on Tutorial from the GTN which is usable either for individual self-study, or as a teaching material in a classroom.

Questions this will address

  • How can my programs do different things based on data values?

Learning Objectives

  • Write conditional statements including if, elif, and else branches.
  • Correctly evaluate expressions containing and and or.

Licence: Creative Commons Attribution 4.0 International

Keywords: Foundations of Data Science, jupyter-notebook

Target audience: Students

Resource type: e-learning

Version: 3

Status: Active

Learning objectives:

  • Write conditional statements including if, elif, and else branches.
  • Correctly evaluate expressions containing and and or.

Date modified: 2023-02-13

Date published: 2022-04-25

Authors: Bazante Sanders, Donny Vrins, Helena Rasche, The Carpentries

Contributors: Bazante Sanders, Beatriz Serrano-Solano, Donny Vrins, Helena Rasche, Wendi Bacon

Scientific topics: Software engineering


Activity log