Hi,

In this article we can see how it’s possible to use conditional execution in python3 :

  1. Use in first « if (condition): »
  2. If this first condition doesn’t respected , use « elif (condition): »
  3. Then, if it’s not enough you can write « else: » this one is for all of the others cases

Capture d’écran 2015-09-18 à 15.49.30

Comment :

Be careful else is used without special condition

The order if-elif -else has to be respected

When a condition is respected the program continue his flow of execution; what’s why I have to write python3 masteries_16_17 each time.

Have a good day !

CC BY 4.0 Masteries 16 and 17 by aureliemartinette is licensed under a Creative Commons Attribution 4.0 International License.