Update page 'Day 9 homework - Sloetjes'
+10
-1
@@ -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?**
|
||||

|
||||
|
||||
**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?**
|
||||

|
||||

|
||||
|
||||
**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.
|
||||
|
||||
Reference in New Issue
Block a user