What is a good practice to check if an environment variable exists or not?
Use the first; it directly tries to check if something is defined in environ. Though the second form works equally well, it’s lacking semantically since you get a value back if it exists and only use it for a comparison. You’re trying to see if something is present in environ, why would you get just … Read more