Editor settings

General settings

Save settings

Learn to program with Python

Importing multiple values #

When working with modules in Python, it is common to import multiple values from a module into your current namespace.

Here's how to import multiple values in Python:

from module_name import value1, value2, value3

In this example, we import the values value1, value2 and value3 from the module_name module. We can then use these values directly without referencing the module name.


Exercise #

Import functions greet1() and greet2() from greetings module and call both functions

Tests #

  • Import function greet1() from greetings module
  • Import function greet2() from greetings module
  • Call greet1("Leena")
  • Call greet2("Dillan")
Output will be displayed here