Conditional structures in Python: the if-else statement

Опубликовано: 14 Сентябрь 2023
на канале: PatchyPython
78
0

The if - else statement allows your program to "branch", that is to execute different instructions according to whether a certain condition is True or False. In this video I review the three main flow control structures of imperative languages such as Python - namely sequential execution, branching and loops. I then introduce the if-else statement with a practical example related to Boyle's law (the one that goes "a watched kettle never Boyles" ;) For more information, see the notebooks below (notebooks will open on Google Colab - no installation required)

Embedded video, part of the following courses:
Computer Programming at Queen Mary, University of London
FREE Jupyter notebook: https://tinyurl.com/4umjbjvp
Coding for Scientists at Queen Mary, University of London
FREE Jupyter notebook: https://tinyurl.com/539p4b5f