0% found this document useful (0 votes)
279 views65 pages

Python Notes

This document provides an overview of Kaushik Shresth's upcoming "2024 Syllabus Based Python Programming Crash Course". The 3-sentence summary is: The course will cover basic Python programming concepts like variables, data types, strings, integers, floats, Booleans, lists, dictionaries, tuples, sets, functions, classes, file operations, and more. It is designed for beginners with no prerequisites and aims to teach all aspects of Python based on the 2024 syllabus. The tutorial also includes instructions on downloading Python and Visual Studio Code to get started with learning to code in Python.

Uploaded by

anandhuashok6959
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
279 views65 pages

Python Notes

This document provides an overview of Kaushik Shresth's upcoming "2024 Syllabus Based Python Programming Crash Course". The 3-sentence summary is: The course will cover basic Python programming concepts like variables, data types, strings, integers, floats, Booleans, lists, dictionaries, tuples, sets, functions, classes, file operations, and more. It is designed for beginners with no prerequisites and aims to teach all aspects of Python based on the 2024 syllabus. The tutorial also includes instructions on downloading Python and Visual Studio Code to get started with learning to code in Python.

Uploaded by

anandhuashok6959
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 65

Kaushik Shresth

The Complete
Python Programming
Language Crash Course
“The Easiest
Python
Programming
Language
Complete Crash
2024
Syllabus Based Python
Programming Crash Course Course”
By Kaushik Shresth
2024 Syllabus Based Python Course

Basic of Basic of Python,


Python & VS
Programming, Syntax,
Code
Everything about Print Function,
Installation In
Python, Comments,
Windows &
Advantages of Terminal,
MacOS
learnning Python. Quotes.

Strings,
Integers, Loops in Python,
Variables in
Floats, Types of Loops,
Python,
Booleans, Loop control
Basics of
Lists, None, statements,
Datatypes.
Dictionary, Infinite Loop.
Tuples & Sets.
2024 Syllabus Based Python Course

Functions in Python,
Operators in Python, PIP in Python,
Function Invocation,
Conditional Statements Everything about pip,
Return Statement,
(if, elif, else), Packages in Python,
Parameters,
Try & Except Statement. Types of Packages.
Default Parameters.

Class,
File Operations
Object/Instance, Practice,
in Python,
Attributes, Projects,
Reading and
Methods, Kuch kaam ki
Writing Files,
Encapsulation, batein tumhare
Everything
Inheritance, liye.
about FileIO.
Polymorphism.
“This Course Is
Designed To Cover
Python Programming
From The Very Basics”
“No Prerequisite,
Just Start Learning”
Kaushik Shresth

“Basics of Programming”
What is
Programming?
Programming refers to the
process of creating sets of
instructions (code) that a
computer can understand and
execute to perform specific
tasks or solve problems.
Who is
Programmer?
A programmer, also known as a
developer or software engineer,
is an individual who writes,
designs, creates, and maintains
computer programs or software
applications.
What is
Python?
Python is a high-level,
interpreted, and versatile
programming language known
for its simplicity and readability.
“History of
Python”
Python, created by Guido van
Rossum, was introduced in 1991.
It aimed to be a readable, high-
level programming language
with a clear, minimalist syntax.
“Advantages
of Learning
Python”
Python's simplicity, adaptability,
and strong community support
make it a favored choice across
industries for its readability,
versatility, and collaborative
environment.
Kaushik Shresth

“Python & VsCode Download”


“Downloading Python”
1 - Search “Python Download” On Google

2 - Click on the “Download Python”


3 - Click on “Downloads” ( Same Process for Windows Also )

4 - Click on the “Python 3.12.1” ( Version may change in future )


“Downloading VsCode”
1 - Search “Vscode Download” On Google

2 - Click on the “Download”


If you’re using Windows, Download Vscode for Windows.

If you’re using Macbook, Download Vscode for MacOs.


Kaushik Shresth

“Follow The
Tutorial To Learn
More About The
Installation
Process”
Kaushik Shresth

“Basics of Python”
“Basics of Python”

Print Function Terminal Comments


In Python, the print() function is The terminal, also known as the Comments in programming
used to display output to the command prompt, shell, or languages, including Python, are
console or standard output. It console, provides an interface for textual annotations within the code
outputs text or values of variables interacting with a computer that are ignored by the interpreter
for the user or developer to see. through text-based commands. or compiler.
“Basics of Python”

Syntax IDE Quotes


Syntax in Python refers to the rules IDE stands for Integrated In Python, quotes are used to
and structure that define how the Development Environment. It's a denote strings. Strings are
Python programming language is software application that provides sequences of characters enclosed
written. comprehensive facilities to computer in either single (' ') or double (" ")
programmers for development. quotes.
Kaushik Shresth

“Variables In Python”
“Variables In
Python”
In Python, variables are used to store data
values. They act as containers for holding
information that can be referenced and
manipulated within a program. Python uses
the equal sign (=) to assign values to
variables. Must start with a letter (a-z, A-Z) or
underscore (_).
Can include letters, numbers, and
underscores. Python variables are case-
sensitive
“Datatypes
In Python”
In Python, data types represent the kind of
value a variable can hold. Python is a
dynamically typed language, which means
you don't need to explicitly declare the data
type of a variable. Instead, Python infers the
data type based on the value assigned to it.
Datatypes - String, Float, Integer, List,
Dictionary, Set, Tuple, Nonetype, Booleans.
Kaushik Shresth

“Strings In Python”
“String In
Python”
In Python, strings are a sequence of characters
enclosed within single quotes (' '), double quotes
(" "), or triple quotes (''' '''). Strings are immutable,
meaning they cannot be changed after they are
created.
You can create strings using single quotes, double
quotes, or triple quotes for multiline strings.
Individual characters in a string can be accessed
using indexing.
You can extract a specific portion (substring) of a
string using slicing.
Strings can be concatenated using the +
operator.
Python has numerous built-in string methods for
various operations such as converting cases,
finding substrings, replacing values, splitting
strings, etc.
Kaushik Shresth

“Integers In Python”
“Integers In
Python”
In Python, integers are whole numbers without
any decimal point. They can be positive or
negative. Python provides support for basic
arithmetic operations and various functions for
working with integers.
Integers are created without specifying the data
type explicitly. They can be assigned directly to
variables.
Python supports various arithmetic operations for
integers such as addition, subtraction,
multiplication, division, modulus, and
exponentiation.
Python has two types of division operators. The
single forward slash (/) performs floating-point
division, while the double forward slash (//)
performs integer division, resulting in a truncated
integer value.
You can convert other data types to integers
using int() function.
Kaushik Shresth

“Floats In Python”
“Floats In
Python”
In Python, floats represent decimal numbers or
numbers with a fractional component. They are
used to represent real numbers and are defined
using a decimal point.
Floats can be created by directly assigning
decimal numbers to variables.
Python supports various arithmetic operations for
floats similar to integers, including addition,
subtraction, multiplication, division, modulus, and
exponentiation.
You can convert other data types to floats using
the float() function.
Kaushik Shresth

“Booleans & Nonetype In Python”


“Booleans &
Nonetype In
Python”
In Python, both Booleans and None represent
different types of values that hold specific
meanings within the language.
Booleans represent the truth values True or
False. They are used in logical operations,
conditions, and control flow statements to make
decisions based on whether an expression
evaluates to True or False.
None is a special constant in Python that
represents the absence of a value or a null value.
It is used to indicate that a variable does not refer
to any object or that a function does not return
any value.
Kaushik Shresth

“Lists In Python”
“Lists In
Python”
In Python, a list is a versatile data structure that
serves as an ordered collection of items. Lists are
mutable, meaning their elements can be changed
after creation. Lists are enclosed in square
brackets [] and can contain elements of different
data types, including integers, strings, floats,
other lists, and more.Lists can be created by
enclosing elements within square brackets and
separating them with commas.
Elements in a list can be accessed using indexing.
Indexing starts at 0 for the first element.
You can extract a specific portion (slice) of a list
using slicing.
Lists are mutable, so you can change, add, or
remove elements after creation.
Lists support various operations like
concatenation (+), repetition (*), and length
determination (len()).
Kaushik Shresth

“Dictionary In Python”
“Dictionary
In Python”
In Python, a dictionary is a versatile and powerful
data structure used to store collections of key-
value pairs. Dictionaries are unordered, mutable,
and enclosed in curly braces {}. Each key in a
dictionary must be unique and immutable (such
as strings, integers, or tuples), while values can be
of any data type.
Dictionaries are created by defining key-value
pairs within curly braces, separated by colons (:)
and commas (,).
Values in a dictionary are accessed by providing
the corresponding key in square brackets ([]).
Dictionaries are mutable, allowing you to change,
add, or remove key-value pairs.
You can remove elements using the del keyword
or the pop() method.
Kaushik Shresth

“Sets In Python”
“Sets In
Python”
In Python, a set is an unordered collection of
unique elements. Sets are defined by enclosing
comma-separated elements within curly braces
{}. Sets are mutable but have no duplicate
elements. They are particularly useful when
dealing with unique elements or performing
mathematical set operations.
Sets can be created using curly braces {} or by
using the set() constructor.
Sets support various operations like adding
elements, removing elements, and performing
mathematical operations like union, intersection,
difference, etc.
Kaushik Shresth

“Tuples In Python”
“Tuples In
Python”
In Python, a tuple is an ordered and immutable
collection of elements. Tuples are similar to lists,
but once created, their elements cannot be
changed, added, or removed. They are defined
using parentheses () and can contain elements of
different data types.
Tuples can be created by enclosing elements
within parentheses and separating them with
commas.
Elements in a tuple are accessed using indexing
similar to lists. Indexing starts at 0 for the first
element.
You can extract a specific portion (slice) of a
tuple using slicing.
Tuples support operations like concatenation (+),
repetition (*), and length determination (len()).
You can assign values from a tuple into multiple
variables in a single line (tuple unpacking).
Kaushik Shresth

“Loops In Python”
“Loops In Python”
In Python, loops are used to execute a block of code repeatedly until a certain condition
is met. There are mainly two types of loops: for loops and while loops.

For Loop While Loop Loop Control Statements

for loops are typically used for iterating over while loops continue to execute a block of Python provides control statements like
sequences like lists, tuples, strings, and code as long as a specified condition is true. break, continue, and else in loops.
dictionaries, or any object that supports
iteration.
Kaushik Shresth

“For Loop In Python”


“For Loop In
Python”
The for loop in Python is used to iterate over a
sequence (such as lists, tuples, strings,
dictionaries, etc.) or an iterable object. It
executes a block of code for each element in the
sequence.
element is a variable that represents each item in
the sequence during iteration.
sequence refers to the collection of elements
being iterated.
The for loop is a fundamental construct in Python
that allows you to iterate through collections or
sequences, making it a powerful tool for handling
repetitive tasks and data processing in various
programming scenarios.
Kaushik Shresth

“While Loop In Python”


“While Loop
In Python”
The for loop in Python is used to iterate over a
sequence (such as lists, tuples, strings,
dictionaries, etc.) or an iterable object. It
executes a block of code for each element in the
sequence.
element is a variable that represents each item in
the sequence during iteration.
sequence refers to the collection of elements
being iterated.
The for loop is a fundamental construct in Python
that allows you to iterate through collections or
sequences, making it a powerful tool for handling
repetitive tasks and data processing in various
programming scenarios.
Kaushik Shresth

“Loop Control Statements In Python”


“Loop Control
Statements In
Python”
In Python, loop control statements are used to alter
the flow of loops. There are three main loop control
statements: break, continue, and else in loops.
The break statement is used to exit a loop
prematurely based on a certain condition. When the
break statement is encountered inside a loop, it
immediately terminates the loop execution.
The continue statement is used to skip the current
iteration of the loop and continue with the next
iteration. It moves the control back to the loop's
beginning.
Python allows an else block to be associated with a
loop. The else block executes when the loop
completes its normal iteration, i.e., without
encountering a break statement.
Kaushik Shresth

“Operators In Python”
“Operators In
Python”
In Python, operators are special symbols or
characters that perform operations on operands
(variables, values, or expressions). Python supports
various types of operators, including arithmetic,
assignment, comparison, logical, identity,
membership, and bitwise operators.

These operators perform mathematical operations.


+ (Addition)
- (Subtraction)
* (Multiplication)
/ (Division)
% (Modulus - returns the remainder)
** (Exponentiation)
// (Floor Division - returns the quotient)

Comparison Operators, Logical Operators


Identity Operators, Membership Operators.
Kaushik Shresth

“Conditional Statements In Python”


“Conditional Statement In Python”
Conditional statements in Python are used to perform different actions based on different conditions.
The most common conditional statements in Python are if, elif (short for "else if"), and else.

IF Statement Elif Statement Else Statement

The if statement is used to execute a block of The elif statement allows you to check The else statement is used to execute a block
code if a condition is true. additional conditions if the preceding if of code when the preceding if or elif
statement's condition is false. It stands for conditions are false.
"else if."
Kaushik Shresth

“Try & Except Statements In Python”


“Try & Except
In Python”
The try and except blocks in Python are used for
exception handling, allowing you to manage and
handle errors or exceptions that may occur during
the execution of code. They help prevent the
program from crashing due to unexpected errors.
The try block contains the code where exceptions
may occur, and the except block catches and
handles those exceptions.
You can handle multiple types of exceptions by
adding multiple except blocks.
Using try and except blocks allows you to gracefully
handle exceptions and continue program execution,
providing a way to deal with unexpected errors
without causing the program to crash.
Kaushik Shresth

“Functions In Python”
“Functions In
Python”
In Python, a function is a block of reusable code that
performs a specific task or set of tasks. Functions
provide modularity, allowing you to break down your
code into smaller, manageable parts, making it easier
to read, understand, and maintain.
You can define a function in Python using the def
keyword followed by the function name and
parentheses containing any parameters. The
function body is indented below.
Functions can take parameters (inputs) to perform
operations based on the provided values.
Functions can return a value using the return
statement. This value can be stored in a variable or
used in other parts of the code.
You can specify default values for parameters,
allowing the function to be called without providing
those arguments. Also, arguments can be passed
using keyword syntax.
Kaushik Shresth

“PIP & Packages In Python”


“PIP In Python”
In Python, pip is a package manager used for installing and
managing additional libraries or packages that extend the
functionality of Python. It stands for "Pip Installs Packages."
pip simplifies the process of downloading and installing
external packages from the Python Package Index (PyPI) or
other package indexes.
To install a package, you can use the pip install command
followed by the name of the package.
You can install a specific version of a package by
specifying the version number along with the package
name.
To uninstall a package, use the pip uninstall command
followed by the name of the package.
To view a list of installed packages and their versions, use
the pip list command.
pip install requests # Installs the 'requests' package pip
install numpy==1.21.3 # Installs a specific version of 'numpy'
pip uninstall requests # Uninstalls the 'requests' package
pip list # Lists all installed packages
“Packages In
Python”
Python packages are collections of modules (Python files)
containing reusable code that can be imported and used in
Python programs. There are two types of packages
Inbuilt Packages
External Packages
These packages are available for various purposes, such as
data manipulation, web development, machine learning, etc.

Popular Python packages include:


numpy (for numerical computations)
pandas (for data manipulation and analysis)
requests (for making HTTP requests)
matplotlib and seaborn (for data visualization)
scikit-learn (for machine learning)
flask and Django (for web development)

Once a package is installed, you can import it into your


Python script or interactive session using the import
statement.
Kaushik Shresth

“File Operations In Python”


“File Operations
In Python”
File operations in Python involve reading from and writing to
files. Python provides built-in functions and methods to
interact with files on the file system.
The open() function is used to open a file. It takes two
parameters: the file name/path and the mode in which the
file should be opened ("r" for read, "w" for write, "a" for
append, "r+" for read and write, etc.).
Once a file is opened in read mode ("r"), you can use
various methods to read its contents.
When a file is opened in write mode ("w"), you can write
data to it using the write() method.
When a file is opened in append mode ("a"), you can add
content to the end of the file using the write() method.
It's good practice to close a file after performing operations
on it using the close() method. However, using a context
manager (with statement) automatically closes the file
when the block inside the with statement is exited.
Kaushik Shresth

“Object-oriented programming
In Python”
“Object-oriented programming In Python”
Object-oriented programming (OOP) is a programming
paradigm that uses objects and classes to design and
structure code. In Python, OOP allows you to create
reusable and modular code by defining classes and objects.
Class: A class is a blueprint that defines the attributes
(properties) and methods (functions) common to all
objects of that class.
Object: An object is an instance of a class. It's a realization
of the class, which contains its own unique data and
methods.
Encapsulation refers to the bundling of data (attributes)
and methods that operate on the data within a single unit
(class). It helps in data hiding and abstraction.
nheritance allows a class (called a child or subclass) to
inherit properties and behaviors (attributes and methods)
from another class (called a parent or superclass).
Polymorphism allows objects of different classes to be
treated as objects of a common parent class. It enables
methods to be overridden in a subclass.
Kaushik Shresth

“Congratulations Guys, You’ve


Completed Python Syllabus”
Practice,
Projects,
Kuch kaam ki
batein Watch This Video One More Time.

Start Writing Your Own Codes.


tumhare liye. Revise The Notes One More Time.

Like This Video, Subscribe The Channel, Drop


“Love You @KaushikShresth” In The Comment
Kaushik Shresth Section.
Share This Video With Your Friends.
The Name’s
Kaushik Shresth.
Thanks for watching this video till the end, I really hope you’ll
have a great programming career, subscribe the channel, like
the video, comment something, share this course with your
friends and family.

Kaushik Shresth

31k YouTube Subscribers.

You might also like