jeudi 20 juillet 2017

Best way of use conditionals in python

I can use the normal conditional:

if a == b: c = d

And also I use the ternary conditional:

c = d if a == b

My question is: Which mode is faster? And if both are equal: Which mode is more "common" or "pythonic"?

Aucun commentaire:

Enregistrer un commentaire