Which of the following can be used to import only a specific function or class from a module?
- from module import function
- import function from module
- import module
- import module.function
You can use 'from module import function' to import only a specific function or class from a module in Python.
Loading...
Related Quiz
- Which method is responsible for cleaning up resources in a context manager?
- What method is used to add a single element to a set in Python?
- What is the result of the intersection operation between two sets?
- In Scikit-learn, ____ is used to encode categorical variables into numerical format.
- What is the primary reason to use method overriding in object-oriented programming?