dimanche 26 juillet 2020

Does if (None in string) return true or false?

I need to check for the occurrence of a value from a dictionary in a string. However some of those values may be None. If the value is None, will the condition return true or false, that is, will the 'None' value be found in the string?

This condition is part of an if statement with multiple conditions that are put together with 'and' and 'or' operators, and hence I can't simply check if the value is None, or separate it and do another if within the main condition. I don't want to implement the alternative of two separate conditions and statements unless it's absolutely necessary.

Aucun commentaire:

Enregistrer un commentaire