Robotics & Artificial Intelligence
A module can be imported and used in another module or script to access its functions and variables.
Related Questions
What would be the output of the following code?
import pandas as pd # Create a DataFrame data = {'Name':['Jai', 'Ella', 'Mike', 'Pihu'], 'Age':[25, 28, 30, 22], 'City':['New York', 'London', 'Paris', 'Sydney']} df = pd.DataFrame(data) print(df['Age'] > 29)Packages are the sub-part of the modules.
A Package is a simple folder that can contain multiple modules.
Modules in Python help in code reusability.