Python CLASS
Python CLASS
Need of programming
To solve various tasks efficiently using softwares - programming codes
basics 1 Page 1
Variables in programming
What is data?
In computers, Binary codes 0s and 1s
Every PL is converted into binary codes.
Basic lecture 3
Basic lecture 5
Functions in
programming
What is a function?
Block of code that do specific tasks.
Example-
• deposit
• withdraw
• balance
Basic lecture 6
Object oriented
programming
basic 4 5 6 Page 3
Objects are specific instances of a class.
Example - phone (class)
Apple samsung nokia (specific instances of a class)
basic 4 5 6 Page 4
Algorithmic way to solve a problem
Input-----algorithm------output
basic 7 8 Page 5
Basic lecture 8
Introduction to python
Free and open source(easy download and use accordingly)
Cross platform compatible (on any OS)
Large standard library(for various purposes python provides)
Object oriented
Downloaded
python
pycharm this an IDE integrated develoment environment
Anaconda for programming it’s a web base app.
basic 7 8 Page 6
Introduction to jupyter
notebook
It is a browser based interpreter that allows python
interaction.
steps to start working
Basic lecture 10
basic 9 10 Page 7
Int integers
Float decimals
Boolean true and false
String character in double quotes
basic 9 10 Page 8
Operators in python
Operations on data or variables using operators
Operators in python
• Relational <,>,==,!=
• Logical &, or, not
• Arithmetic +,-,/,*
basic 11 12 Page 9
Basic class 12
python tokens
Smallest meaningful component in a programm is token
• Keywords (special reserved words give info to compiler or interpreter)
• Identifiers (names used for variable function or obj.)
Rules
1. No special character except _
2. Case sensitive
3. First letter can't be a digit
• Literals(constants in python)
• Operators
*We can't use keywords as variable class or function name as it causes error.*
basic 11 12 Page 10
Strings
They are sequence of characters in single double or triple quotes.
String functions
basic 13 Page 11
basic 13 Page 12
basic 13 Page 13
Python tuples
tup1=(1,a,True)
basic 14 Page 14
basic 14 Page 15
basic 14 Page 16
basic 14 Page 17
Lists in python
List is an ordered collection of elements in[]
Their values can be changed.
basic15 Page 18
basic15 Page 19
basic15 Page 20
basic15 Page 21
Dictionary in python
it is an unordered collection of key value pairs enclosed in {}.
Values can be changed .
basic16 Page 22
basic16 Page 23
Set in python
Set is an unordered and unindexed collection of elements enclosed in {}
Duplicates arent allowed in a set.
s1={1,"a",True}
SET OPERATIONS
basic 17 Page 24
basic 17 Page 25
If statement
• If with list
basic18 Page 26
• If with Dictionary
basic18 Page 27
Looping statements in python
basic 19 Page 28
basic 19 Page 29
basic 19 Page 30
basic 19 Page 31
Problems in python
basic20 21 Page 32
BASIC LECTURE 21
FUNCTIONS IN PYTHON
basic20 21 Page 33
basic20 21 Page 34
basic20 21 Page 35
Intro - Object oriented programming
OOPS 1 Page 36
OOPS 1 Page 37
Creating class
• 1st word of class capital
oops2 Page 38
Adding parameters to a class method
oops3 Page 39
Creating class with constructor
oops4 Page 40
Inheritance in python
oops5 Page 41
oops5 Page 42
oops5 Page 43
Types of inheritance
oops6 Page 44
oops6 Page 45
oops6 Page 46
oops6 Page 47
Introduction to numpys
python ml 1 Page 48
python ml 1 Page 49
python ml 1 Page 50
Joining numpy arrays
python ml 2 3 4 Page 51
python ml 2 3 4 Page 52
Numpy array mathematics
python ml 5 6 Page 53
python machine learning lecture 6
python ml 5 6 Page 54
Introduction to pandas
python ml 7 8 Page 55
python ml 7 8 Page 56
python ml 7 8 Page 57
python ml 7 8 Page 58
python ml 7 8 Page 59
python ml 7 8 Page 60
Intro to panda dataframes
python ml 10 Page 61
python ml 10 Page 62
python ml 10 Page 63
Panda functions more
python ml 11 Page 64
Lesson 1