0% found this document useful (0 votes)
8 views

Prac1 AAM

This document outlines the installation process of Python and introduces its features, libraries, and tools. Python is a versatile programming language widely used in various domains such as web development, data science, and automation. It also details popular libraries like NumPy, Pandas, and Matplotlib, as well as tools for development, testing, and documentation.

Uploaded by

Khan Rahil Ahmed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Prac1 AAM

This document outlines the installation process of Python and introduces its features, libraries, and tools. Python is a versatile programming language widely used in various domains such as web development, data science, and automation. It also details popular libraries like NumPy, Pandas, and Matplotlib, as well as tools for development, testing, and documentation.

Uploaded by

Khan Rahil Ahmed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Practical – 1:

Aim: - Installation of python, tools and libraries used in python & also study of google
collab:

Introduction to Python: -
Python is a versatile and high-level programming language that has gained widespread popularity for its
simplicity, readability, and flexibility. Guido van Rossum released the first version of Python in 1991, and since
then, it has evolved into a powerful tool used in various domains such as web development, data science,
artificial intelligence, automation, and more.

Some features of Python: -


1. Readable and Expressive Syntax: Python is known for its clean and readable syntax, which resembles
the English language. This makes it easy for beginners to learn and understand, and it enhances
collaboration among developers.
2. Versatility: Python supports multiple programming paradigms, including procedural, object-oriented, and
functional programming. This flexibility allows developers to choose the approach that best suits their
project requirements.
3. Extensive Standard Library: Python comes with a vast standard library that provides modules and
packages for a wide range of tasks, from handling data structures to implementing networking protocols.
This reduces the need for external libraries in many cases.
4. Community and Documentation: Python has a large and active community of developers who contribute
to its growth and provide support through forums and online resources. The official Python documentation
is comprehensive and serves as an excellent reference for users at all levels.
5. Cross-Platform Compatibility: Python is cross-platform, meaning code written in Python can run on
various operating systems without modification. This portability makes it an excellent choice for
developing applications that need to run on different platforms.

Some common uses of Python:


1. Web Development: Python is widely used for web development, with frameworks like Django and Flask
making it easy to create scalable and maintainable web applications.
2. Data Science and Machine Learning: Python has become the go-to language for data science and
machine learning projects. Libraries such as NumPy, Pandas, and scikit-learn provide powerful tools for
data manipulation, analysis, and machine learning.
3. Automation and Scripting: Python's simplicity makes it an ideal choice for writing scripts and
automating repetitive tasks. It is commonly used for system administration, network programming, and
workflow automation.
4. Scientific Computing: Scientists and researchers use Python for scientific computing due to its rich
ecosystem of libraries, including SciPy and Matplotlib, which facilitate tasks such as numerical
simulations and data visualization.
5. Artificial Intelligence and Natural Language Processing: Python is widely adopted in the fields of
artificial intelligence and natural language processing. Libraries like TensorFlow and PyTorch are popular
choices for building and training machine learning models.

Libraries in Python:
Library refers to a collection of pre-written code and functionalities that can be used by developers to perform
common tasks without having to implement those functionalities from scratch. Libraries provide a set of
functions, classes, and modules that can be imported and used in Python scripts or applications, allowing
developers to save time and effort by reusing existing code.

Libraries in Python serve various purposes, such as data manipulation, numerical operations, web development,
machine learning, and more. They are typically organized into modules, and each module contains a set of
related functions or classes. Developers can import specific modules or the entire library into their Python
scripts, giving them access to the library's capabilities.

Some well-known libraries:


NumPy:
● Explanation: NumPy (Numerical Python) is a fundamental library for scientific computing in Python. It
provides support for large, multi-dimensional arrays and matrices, along with mathematical functions to
operate on these arrays.
● Example:
● import numpy as np

● # Creating a NumPy array
● arr = np.array([1, 2, 3, 4, 5])

● # Performing operations on the array
● mean_value = np.mean(arr)

Pandas:
● Explanation: Pandas is a data manipulation and analysis library. It provides data structures like
DataFrames for efficient manipulation and analysis of structured data.
● Example:
● import pandas as pd

● # Creating a DataFrame
● data = {'Name': ['Alice', 'Bob', 'Charlie'],
● 'Age': [25, 30, 22]}
● df = pd.DataFrame(data)

● # Performing operations on the DataFrame
● mean_age = df['Age'].mean()

Matplotlib:
● Explanation: Matplotlib is a 2D plotting library for creating static, animated, and interactive
visualizations in Python. It provides a wide variety of charts and plots.
● Example:
● import matplotlib.pyplot as plt

● # Creating a simple plot
● x = [1, 2, 3, 4, 5]
● y = [2, 4, 6, 8, 10]
● plt.plot(x, y)
● plt.xlabel('X-axis')
● plt.ylabel('Y-axis')
● plt.show()

Tools Used for Python:


Tools are software applications or utilities that assist developers in various tasks related to coding, testing,
debugging, and project management.

1. Integrated Development Environments (IDEs):


● PyCharm: A popular Python IDE with features like code completion, debugging, and a visual
debugger.
● VSCode (Visual Studio Code): A lightweight and extensible code editor with excellent Python
support.
● Jupyter Notebooks: An interactive computing environment that allows the creation and sharing of
live code, equations, visualizations, and narrative text.
2. Package Managers:
● pip: The default package installer for Python. It is used to install and manage external libraries and
packages.
● conda: A package manager and environment manager for Python, mainly used for data science and
scientific computing.
3. Version Control:
● Git: A distributed version control system widely used for tracking changes in source code during
software development.
● GitHub, GitLab, Bitbucket: Web-based platforms that provide hosting for software development
projects using Git.
4. Testing Frameworks:
● unittest: A built-in testing library in Python for writing and running unit tests.
● pytest: A third-party testing framework that simplifies the process of writing and executing tests.
5. Code Linters:
● flake8: A tool that checks code against style and programming errors. It includes PyFlakes,
pycodestyle, and McCabe.
● pylint: A static code analysis tool that checks for errors, coding standards, and code smells.
6. Documentation Tools:
● Sphinx: A tool that makes it easy to create intelligent and beautiful documentation for Python
projects.
● Doxygen: Although commonly used for C++, Doxygen can also be used for documenting Python
code.
7. Virtual Environments:
● venv: A module that provides support for creating lightweight, isolated Python environments.
● virtualenv: A third-party tool for creating isolated Python environments.
8. Profiling and Optimization:
● cProfile: A built-in module for profiling Python programs to identify performance bottlenecks.
● line_profiler: A third-party package for line-by-line profiling of Python functions.
9. Database Tools:
● SQLAlchemy: A SQL toolkit and Object-Relational Mapping (ORM) library for Python.
● psycopg2: A PostgreSQL adapter for Python.
10. Web Development Frameworks:
● Django: A high-level web framework for building web applications quickly.
● Flask: A lightweight and flexible micro web framework for Python.

Python Installation:
We are going to following some steps for installing the latest version of Python for Windows OS:
Step 1: Visit the official Python Website: https://www.python.org/

Step 2: Click and download the latest version of Python:

Step 3: After downloading .exe file, go to File Explorer > Download > and python-3.12.1-amd64.exe file

Step 4: Check both Options below & click “Install Now”:


Step 5: Wait for the setup to complete:

Step 6: Click on “Disable path length limit” & close the setup:
Step 7: Go to Start > Search for Python > Click & Run the Python CMD:

After this we can use Python directly or with integrate it with an IDE (VS Code) or can download a dedicated
IDE (PyCharm).

Conclusion: Therefore, we now have Downloaded, Installed & Setup Python into the Computer and
successfully performed this practical.

Process Related Product Related Total Dated


(15) (10) (25) Signature

You might also like