Write a program to implement Digital Logic Gates – AND, OR, NOT, EX-OR
Output:
Install NumPypackage with pip and explore it.
Check Python Installation
First check whether Python is installed on your system.
Step 1
Press Windows + R
Step 2
Type
cmd
and press Enter.
Step 3
Type the following command:
python --version
If Python is installed, it will show something like:
Python 3.x.x
If not installed, download Python from:
[Link]
Check pip Installation
pip is the package manager used to install Python libraries.
Type:
pip --version
If installed, it will show the pip version.
If pip is missing, run:
python -m ensurepip --upgrade
Install NumPy
NumPy is used for arrays, matrices, and mathematical calculations.
Command
pip install numpy
After installation verify:
python -c "import numpy; print(numpy.__version__)"
Install Matplotlib (PlotPy for Graphs)
PlotPy normally refers to [Link], used for drawing graphs
and plots.
Command
pip install matplotlib
Verify installation:
python -c "import matplotlib; print(matplotlib.__version__)"
Install SciPy
SciPy is used for scientific calculations, optimization, statistics, and
signal processing.
Command
pip install scipy
Verify installation:
python -c "import scipy; print(scipy.__version__)"
Install All Three Together (Shortcut Method)
You can install all packages in one command:
pip install numpy matplotlib scipy
Import numpy, Plotpy and Scipy and explore their functionalities.
NumPy
NumPy (Numerical Python) is a library used for numerical computations and
array operations. It provides powerful tools to work with arrays, matrices, and
mathematical functions.
It is widely used in data science, machine learning, and scientific computing.
Important Features
• Multi-dimensional arrays
• Mathematical operations
• Matrix operations
• Statistical calculations
Output:
Matplotlib (PlotPy)
Matplotlib is a Python library used for data visualization and plotting graphs.
It helps to create line graphs, bar charts, pie charts, histograms, etc.
The module [Link] (PlotPy) is commonly used for plotting graphs.
Important Features
• Line graphs
• Bar charts
• Pie charts
• Data visualization
Output:
SciPy
SciPy is a scientific computing library built on top of NumPy.
It provides functions for advanced mathematics, optimization, statistics,
integration, and linear algebra.
Important Features
• Linear algebra
• Optimization
• Integration
• Statistics
• Signal processing
Output: