vendredi 28 décembre 2018

If-else statements Python

I was wondering why we write "elif", if we could just write "if" for a "elif" statement.

Just a question of curiosity, why do we write "elif e == (f + 10)" instead of just "if e == (f+10)"?

e = 20

f = 10

elif e == (f + 10):
    print("e is 10 more than f")

Why can't I replace the "elif" with "if" and tell me why that wont work if I replace with my adulation.

Aucun commentaire:

Enregistrer un commentaire