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()fromgreetingsmodule - Import function
greet2()fromgreetingsmodule - Call
greet1("Leena") - Call
greet2("Dillan")
Getting Started with Python
Data Types
Python Functions
Statements in Python
Basic Debugging in Python
Basic Algorithm
Object-Oriented Programming
Error Handling
Intermediate Algorithm
Python Modules