From 436ecf2c282f15ae81705488adfbb7825bb91c59 Mon Sep 17 00:00:00 2001 From: "xuanyi.wang" Date: Wed, 19 Apr 2023 04:48:17 +0200 Subject: [PATCH] Update page 'Day 9 homework - Sloetjes' --- Day 9 homework - Sloetjes.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Day 9 homework - Sloetjes.md b/Day 9 homework - Sloetjes.md index 195cc34..5acf837 100644 --- a/Day 9 homework - Sloetjes.md +++ b/Day 9 homework - Sloetjes.md @@ -46,5 +46,14 @@ print(get_all_modules_size()) **3. Run your Python interpreter like you would normally, using Jupyter, and run the last function. How many bytes are being used?** ![Q3](https://gogs.gtsplab.com:5432/j/python-bootcamp/raw/Branch_Sloetjes/Q3.png) + **4. Now, run the same function, but start the Python interpreter in Powershell (Windows), or the regular shell (MacOS/Linux) with the `-E` flag, which ignores environment variables and should only load the modules that came with the original build of the Python interpreter. How many bytes are being used now?** -![Q4](https://gogs.gtsplab.com:5432/j/python-bootcamp/raw/Branch_Sloetjes/Q4.png) \ No newline at end of file +![Q4](https://gogs.gtsplab.com:5432/j/python-bootcamp/raw/Branch_Sloetjes/Q4.png) + +**5. With only the `sys` module loaded, look at the `sys.modules` dict. What is the type of the value of the `os` key?** +##### Answer: +The type of the value of the `os` key in the sys.modules dictionary depends on whether the os module has been loaded yet. + +If the `os` module has not been loaded yet, the value of the `os` key will be `NoneType`. + +If the os module has been loaded, the value of the os key will be a module object representing the `os` module.