There is exists a pythonic way for doing somethings like that?
>> list.append(elem) if condition else pass
>> list.append(elem) if condition else other_list.append(elem)
I have needed sometimes something like that and I don't know the best way for accomplish it.
Thanks.
Aucun commentaire:
Enregistrer un commentaire