How I can make a conditional in python that checks for this three keywords defined in the dictionary and that they are not False
?
settings = {
'proxy_host': '127.0.0.1',
'proxy_port': 8080,
'proxy_protocol': 'socks',
}
I have tried with the sentence you can see below. But this is only checking that these keywords exists in the dictionary settings
without bothering about what type of value has.
if 'proxy_host' and 'proxy_port' and 'proxy_protocol' in settings:
I only want my IF to True If none of the keywords are falsely and they all exist as keys.