xxxxxxxxxx
# Ways to import in Python
import 'module_name'
import 'module_name' as 'name'
from 'module_name' import *
from 'module_name' import 'name', 'name'
from 'module_name' import 'name' as 'new_name', 'name' as 'new_name'
xxxxxxxxxx
Command: import
What is import: Import Statement
Description: The import statement is used to import modules or specific functions, classes, or variables from modules into your Python script.
Example: import math will import the math module, allowing you to use its functions, like math.sqrt(4) to calculate the square root of 4.
xxxxxxxxxx
# importing a module
import math
# using the sqrt() function of the math module
print("Square root of 16:", math.sqrt(16))