mardi 3 mars 2015

Compacting an if statement

I want to write this if statement as compact as possible (to avoid having duplicate code)



if length == 10 if boolean is False or length == 13 if boolean is True:


The part that PyCharm does not like is the



if boolean is True


It asks for a colon.


PyCharm does not allow me to run it. Does anyone have a nice compact solution to this if?


Aucun commentaire:

Enregistrer un commentaire