The All python inbuilt function [closed]
if all(x not in phonebookcontent for x in [firstname, lastname, phone]) and phonebook_rule.match(imp):
This statement, how I can say "if one of [firstname, lastname, phone] is not in phonebookcontent then we can apply something" it's like the "or" statement instead of "all" that can be like "and"
Solution 1:
if any(x not in phonebookcontent for x in [firstname, lastname, phone]) and phonebook_rule.match(imp):
https://docs.python.org/3/library/functions.html#any