Update page 'Day 9 homework - Sloetjes'
@@ -76,4 +76,4 @@ print(login)
|
|||||||
|
|
||||||
* In the code above, the name of the module is `"os"`, and the fromlist argument is not given, so the top-level package `"os"` is returned, which is equivalent to importing os with a regular import statement.
|
* In the code above, the name of the module is `"os"`, and the fromlist argument is not given, so the top-level package `"os"` is returned, which is equivalent to importing os with a regular import statement.
|
||||||
|
|
||||||
Therefore, the expression `__import__('os').getlogin()` is equivalent to `os.getlogin()`, but it dynamically imports the `os` module at runtime instead of using a regular import statement.
|
* Therefore, the expression `__import__('os').getlogin()` is equivalent to `os.getlogin()`, but it dynamically imports the `os` module at runtime instead of using a regular import statement.
|
||||||
|
|||||||
Reference in New Issue
Block a user