Toggle navigation
JUPYTER
FAQ
View as Slides
View as Code
Python 3 Kernel
View on GitHub
Execute on Binder
Download Notebook
intro-to-python
03_conditionals
Notebook
Chapter 3: Conditionals & Exceptions (TL;DR)
¶
boolean expressions
evaluate to either
True
or
False
relational operators
(e.g.,
==
or
!=
) compare operands according to "human" interpretations
logical operators
(e.g.,
and
)combine boolean sub-expressions to more "complex" expressions
the
conditional statement
(i.e., the
if
statement) allows
controlling
the
flow of execution
depending on some
conditions
a
conditional expression
is a short form of a conditional statement
exception handling
is also a common way of
controlling
the
flow of execution
, in particular, if we have to be prepared for bad input data