Python Course
Python Course
PROGRAMMING
HELLO!
I am Roheeth
I am here to share my knowledge on Python
2
1
DEMO
Day - 1
3
What You’ll Learn Today
4
By the end of this session
5
Introduction to Software Programming
6
Language Processors
7
Language Processors
8
Language Processors
¤ Compiler
9
Language Processors
¤ Assembler
10
Language Processors
¤ Interpreter
11
Introduction to Python
¤ Evolution of Python
12
Introduction to Python
¤ Implementations of Python
13
Why Python?
¤ Features of Python
14
Why Python?
¤ Versatility of
Python
15
2
DEMO
Day - 2
16
What You’ll Learn Today
17
Course Curriculum overview
¤ Operators
ø Basic Operators
ø Chained comparison operators
¤ Python Statements
ø Conditional statements
ø Loops
ø Comprehensions
19
Course Curriculum overview
20
Course Curriculum overview
21
Course Curriculum overview
22
Course Curriculum overview
23
At the end of course
24
INR 6,00,000 PA
Average salary for a python programmer
200K
Live job oppurtunities
25
3
DEMO
Day - 3
26
What You’ll Learn Today
¤ Python Installation
¤ Interactive mode vs Script mode
¤ Introduction to IDE
¤ Anaconda Distribution
27
By the end of this session
28
Python Installation
29
Interactive mode vs Script mode
30
Introduction to IDE
31
Introduction to Anaconda
32
Introduction to Anaconda
33
4
Demo
Day - 4
34
What You’ll Learn Today
¤ Keywords
¤ Variables & Identifiers
¤ Indentation and Line continuation
¤ Comments in Python
35
By the end of this session
36
Keywords
37
Keywords
Keywords Usage
True, False Boolean values
None Null object
and, or, not, in, is Logical and identity
operators
if, elif, else Conditional statements
for, while, break, continue Loops
def, class, with, as, pass, Structures
lambda
return, yield Return output
import, from, as Libraries
try, except, raise, finally, assert Exception Handling
38
async, await Asynchronous functions
Identifiers vs Variables
39
Assignment Operator
40
Assignment Operator
41
Assignment Operator
43
Indentation and Line Continuation
44
Comments
47
What You’ll Learn Today
48
By the end of this session
51
Objects and Data Structures
Data Structures
Arithmetic Files
None
Integral Real
Imaginary Mutable
Dictionaries
Complex
Non-
Sequences
Sequential
Mutable Immutable
Mutable Immutable
Non-Linear
Lists Linear Lists
Lists
52
Stacks Queues Graphs Trees
Type Casting
53
Explicit Type Casting
55
What You’ll Learn Today
¤ Containers in Python
¤ Sequenced Containers
¤ Non-Sequenced Containers
¤ Strings in python
56
By the end of this session
¤ Literals vs Variables
¤ Concept of containers
¤ Containers available in Python
¤ Concept of strings
57
Containers in Python
58
Sequenced Containers
59
Non-Sequenced Containers
60
Sequenced Containers
¤ Strings
ø A string in Python is a sequence of characters. It
is a derived data type.
ø Strings are immutable. This means that once
defined, they cannot be changed.
ø It is of the <<class str>>
61
Sequenced Containers
¤ Strings - Indexing
Indexing in a string
62
Sequenced Containers
63
String Formatting
64
String Formatting
ASCII Carriage
\" Double quote \r
Return
ASCII Horizontal
\a ASCII Bell \t
Tab
Character with hexadecimal value
\xHH \v ASCII Vertical Tab
HH
\ooo Character with octal value ooo
67
What You’ll Learn Today
¤ Escape Sequences
¤ Functions and Methods for strings
68
By the end of this session
69
Escape Sequences
ASCII Carriage
\" Double quote \r
Return
ASCII Horizontal
\a ASCII Bell \t
Tab
Character with hexadecimal value
\xHH \v ASCII Vertical Tab
HH
\ooo Character with octal value ooo
https://www.sciencebuddies.org/science-fair-projects
70
/references/ascii-table#asciitable
Functions and Methods for strings
enumerate() Used to generate the ordered pair of the index and value
split() Used for splitting strings into list of broken strings from left to
right
rsplit() Used for splitting strings into list of broken strings from right to
left
splitlines() Used for splitting strings into list of broken strings from line
break
count() Used for returning the count of a substring
swapcase() Used to swap case from lower to upper and vice versa 72
8
Python Course
Day - 8
73
What You’ll Learn Today
74
By the end of this session
75
Functions and Methods for strings
77
Functions and Methods for strings
¤ Reverse a string
¤ Remove a character from a string
¤ Check if a substring is present in string
¤ Form a new word using even and odd index
¤ Replace the occurrences of a substring in string
¤ Make a string of first and last two characters of a
string
¤ Find the duplicates in a string
79
9
Python Course
Day - 9
80
What You’ll Learn Today
¤ Lists in python
¤ Functions and Methods of Lists
81
By the end of this session
¤ Indexing of lists
¤ Mutability in lists
¤ Slicing of lists
¤ Working with lists
82
Lists
83
Lists
¤ Slicing in Lists
¤ Slicing can be done using the slicing operator “ :
”
¤ Usage – List[Start_Index:End_Index:Step]
¤ Mutability in Lists
¤ Items are mutated using the index
84
Lists
¤ Indexing in lists
85
Functions and Methods in Lists
enumerate() Used to generate the ordered pair of the index and value
88
What You’ll Learn Today
¤ Tuples in python
¤ Functions and Methods of Lists
89
By the end of this session
90
Tuples
91
Tuples
¤ Slicing in Tuples
¤ Slicing can be done using the slicing operator “ :
”
¤ Usage – Tuple[Start_Index:End_Index:Step]
¤ Mutability in Tuples
¤ Items cannot be mutated
92
Tuples
¤ Indexing in tuples
93
Functions and Methods in Tuples
enumerate() Used to generate the ordered pair of the index and value
94
Functions and Methods in Tuples
95
11
Python Course
Day - 11
96
What You’ll Learn Today
97
By the end of this session
98
Bytes and Bytearrays
99
Bytes and Bytearrays
enumerate() Used to generate the ordered pair of the index and value
partition() Used to split the byte string based on separator from left to
right
rpartition() Used to split the byte string based on separator from right to
left
zfill() Used to left pad the byte string with zero’s for required length
104
Methods in bytearray
106
What You’ll Learn Today
107
By the end of this session
¤ Hashing
¤ Working of sets in python
¤ Working with sets in python
108
Concept of hash table
109
Concept of hash table
¤ The mapping between an item and the slot where that item
belongs in the hash table is called the hash function. The hash
function will take any item in the collection and return an integer
in the range of slot names, between 0 and m-1
¤ A collision occurs when the algorithm generates the same hash for
more than one value.
¤ The systematic method for placing the second item in the hash
table is called collision resolution.
¤ Open addressing
¤ Separate Chaining
111
Sets
112
Sets
enumerate() Used to generate the ordered pair of the index and value
113
Sets
update() Update the set with the union of this set and others
115
13
Python Course
Day - 13
116
What You’ll Learn Today
117
By the end of this session
¤ Hash Map
¤ Working with dictionaries in python
118
Dictionaries
119
Concept of hash map
120
Concept of hash map
121
Dictionaries
enumerate() Used to generate the ordered pair of the index and value
items() Returns a list containing a tuple for each key value pair
124
What You’ll Learn Today
¤ Operators in Python
125
By the end of this session
126
Operators
¤ Arithmetic Operators
¤ Comparison Operators
¤ Logical Operators
¤ Bitwise Operators
¤ Assignment Operators
¤ Identity Operators
¤ Membership Operators
¤ Augmented Assignment Operators
127
15
Python Course
Day - 15
128
What You’ll Learn Today
¤ Python Statements
¤ Conditional Statements
¤ Iteration Statements
129
By the end of this session
¤ Control Structures
¤ Working with control structures in python
130
Control Structures
131
Control Structures
132
Conditional Statements
133
Iteration Statements
134
Definite Iteration Statements
135
In-Definite Iteration Statements
136
Iteration Statements
138
What You’ll Learn Today
¤ Comprehensions
¤ Sample Exercises using selection and repetitive
control structures
139
By the end of this session
140
Comprehensions
141
THANKS!
Any questions?
You can find me at
[email protected]
142