0% found this document useful (0 votes)
2 views151 pages

Python Basic

Uploaded by

Rakholiya Ayush
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views151 pages

Python Basic

Uploaded by

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

Python Notes

By

@codewith_random

Happy Learning......
Index

Python Basic
Function
Modules and Packages
Data Structures
File Handling
Object-Oriented Programming
Error Handling and Exceptions
Function Programming
Advanced-Data Structures
Database
Web Development With Python
Machine Learning and Data Science
Concurrency and Multithreading
API Integration
Python Basics

1.1 Introduction

Python is a well-liked high-level programming language


known for its ease of use and adaptability. "Guido Van
Rossum" developed Python in the late 1980s, and it has
since become widely used in a variety of fields such as

web development, data analysis, artificial intelligence,


scientific computing, and more.

.Python is known for its readable syntax, which focuses


readability of the code and lowers of the cost of program
maintenance. Code blocks are defined by indentation.
which eliminates the need for explicit braces or keyword
and improves the consistency and clarity of the code.

The procedural and object-oriented programming


paradigms are both supported by Python, giving
developers more freedom when creating software
structures. Through classes and modules, it promotes
code reuse and modularity, making it simples to handle

complicated projects.

Python's huge standard library, which provides a variety


or pre-built modules and functions that makes certain
jobs easier, is one of its strengths. This library makes it
easier for developers to manipulate files, communicate
over networks, analyse data and more.

Python's dynamic typing system promotes quick


development by allowing variables to be assigned without
functional programming..

Libraries like NumPy, pandas, and scikit-learn highlight


the language's attraction in data science and machine
learning. These technologies enable innovative Al
research and applications development by enabling
effective data manipulation, analysis, and model training.

Python's web frameworks, such as "Django" and "Flask"


make it easier to construct online applications, allowing
for the development of dynamic and interactive
webpages. Its connectivity with several operating
systems, such as Windows, macOS, and Linux, Further
enhances its adaptability.

Python code may be dynamically and interpretively


performed without the need for compilation, which
speeds up the development process. Its interactive shell
makes testing and experimenting easier, assisting both
experts and students.

1.2 Variables

In Python, variables are essential building blocks for


managing and storing data inside programs. To store
data like numbers, text or objects, they serve as named
placeholders. Python variables feature dynamic typing.
which allows them to change type while being used, so
you don't need to explicitly indicate what type you want
to them to be.

Simple rules for naming must be followed when choosing


a variable's name, and the "=" sign is used for adding on
a value. For Example:
age 20
=

name = "Pawan"

"age" and "name" are variables here, and the values "20"
and "Pawan" are what they represent. Based on the value
supplied to the variable, Python finds the proper data
types to assign.

# Integers (int), Floating-point numbers (Float), strings


(str), lists (list), dictionaries (dict) and other data types
include several data types of data that may be stored in
variables, For Example:
temperatire = 97.6
days_of_week = ["Monday", "Tuesday", "Sunday"]

# The usage of variable sin your code enables dynamic


and interactive behaviour by allowing calculations to be
performed, user input to be stored, and data

manipulation to be made possible. For Example:


radius = float (input ("Enter the radius: "))
area = 3.14 * radius ** 2
printf ("The area of the circle is: ", area)

Important: -

Python variables must be begin with letter (a-z, A-Z) or

an underscore ( ), and they are case-sensitive


("myVariable" and "myvariable) are two separate
variable. They are not Python keywords and may also
have numbers (after the first character).
Keep in mind that variables are pointers to places in
memory where data is kept, not just simple container.
Functions
Modules and Packages
Data Structures
File Handling
Object-Oriented Programming
Error Handling and Exceptions
Function Programming
Advanced-Data Structures
Database
Web Development with Python
Machine Learning and Data Science
Concurrency and Multi-Threading
API Integration

You might also like