I want to check my environment for the existence of a variable, say “FOO”, in Python. For this purpose, I am using the os standard library. After reading the library’s documentation, I have figured out 2 ways to achieve my goal:
if “FOO” in os.environ:
if os.getenv(“FOO”) is not None:
I would like to know ….