Import specific Python function without importing entire module

Question:
When importing a Python module, how can you import specific functions from that module without importing the entire module, and what is the correct syntax?

  1. from module_name import function_name
  2. import function_name from module_name
  3. import module_name.function_name
  4. from module_name as function_name
Answer:
A - is the correct answer. The correct way to import a specific function from a module is using from module_name import function_name. This allows the function to be used directly without loading the entire module, which is more memory efficient