vendredi 30 novembre 2018

If any list item is different from

I have a list:

infos = [shot['first_frame'], shot['last_frame'], shot['duration']]

I need to check if any of those list items is different from 0 or None.

I have the following "if any" solution but I can't figure out how to add the "different from" part.

if any(value in ['', '0'] for value in infos):

Aucun commentaire:

Enregistrer un commentaire