os.environ['MODE'] = 'production' sets the variable in Python's environment dictionary. os.putenv('MODE', 'production') sets it at OS level. Both affect subprocesses.
Step 2: Check for invalid methods
os.setenv does not exist in Python standard library.
Final Answer:
Both A and B -> Option B
Quick Check:
Set env var in Python = os.environ or os.putenv [OK]
Quick Trick:Use os.environ or os.putenv to set env vars in Python [OK]
Common Mistakes:
Using non-existent os.setenv
Thinking only one method works
Master "Standard Library Usage" in Python
9 interactive learning modes - each teaches the same concept differently