Abhijit Gatade
14+ years experience in the field of Development & Training
Web Developer, Windows Application
Mobile Applications
Web + Mobile
ERP - Hospital, Advertisement, Steel Traders, E-Commerce, website
AI, DS
Full Stack Developer + AI Knowledge
Python - Language of AI - Time of Python
1991-1992
English communicate - Interpretation
Python - Run - Slow Language
C/C++/Java - Code - Compile - Machine Language - Execute
2 Important Things -
1. Time Complexity - i3,i5,i7,i9 - CPU,GPU
2. Space Complexity - RAM - 512 MB - 32GB
2005 - Travis Oliphant - Library - numpy - Python
2008 - Wes McKinney - Library - pandas - Python
Matplot, seaborn, spacy, scipy....
Python can be used for anything
1. Console Application - Started 1960
2. Windows Application - 1990
3. Web - Internet(1994-1995) - 1995
4. Mobile Application - 2008
5. Distributed Computing(Cloud)- 2010
6. Data Science - 2015
7. Attention(Transformer)Google- 2017
8. Artificial Intelligence - 2017
99% - Python
1% - Other(R)
Learning in Python
- Basic & User Input
- Decision Making
- Loops
- Collections
- List
- Tuple
- Dict
- Set
- Functions
- Modules
- Exceptions
- File Handling
- OOPs - Class and Object
-------------------------------------------------
Python is a high-level, interpreted, interactive and object-oriented scripting
language.
Developed by Guido van Rossum - 1991/1992
Python - Latest version - 3.14
To run python execute command
python [Link]
2nd program
Your name please:Abhijit
Hello Abhijit. Welcome to Python.
Coding only 3 things happen
1. User Input -> Process -> Output
name = input("Your name please:")
print("Hello", name, ". Welcome to Python.")
x = 20
y = 30
z = x + y
Variable - it is space in memory with name.
input() - value is in string datatype.
'20'+'30' = '2030'
datatypes: type of data
liquid, solid, airy, semi-solid
numbers - 1. int(complete) 2. float(incomplete)
string - str
boolean - True/False
date -
....
Convert string to required format
int(st), float(st), boolean(st), date(st)...
x = int(input("Enter first number:"))
y = int(input("Enter second number:"))
z = x + y
print("Addition is:", z)
-----------------------------------------------
1. Math operations on 2 numbers
Enter first no:50.5
Enter second no:5
Addition is: 55.5
Subtraction is:
Multiplication is:
Division is:
Variable name rules -
- No space allowed
- No special character allowed($%^&*(#@$^) except '_'
- Cannot start with number -
right - no1, no_1, number1, no_1_var
wrong - 1no, 1_no, 1number, no 1
Division operation
Divident
Divisor
Division/Quotient
Remainder
no1 = float(input("Enter first number: "))
no2 = float(input("Enter second number: "))
add = no1 + no2
sub = no1 - no2
mul = no1 * no2
div = no1 // no2
rem = no1 % no2
print("Addition is:", add)
print("Subtraction is:", sub)
print("Multiplication is:", mul)
print("Division is:", div)
print("Remainder is:", rem)
2. Write a program to calculate area of circle
Formula - pi * r * r
pi - 3.14
Enter radius: 5
Area of Circle: 78.5
radius = float(input("Enter radius:"))
area = 3.14 * radius * radius
print("Area of Circle:", area)
3. Area of Rectangle
length = float(input("Enter length:"))
breadth = float(input("Enter breadth:"))
area = length * breadth
print("Area of rectangle is:", area)
4. Area of Square
side = float(input("Enter side length:"))
area = side * side
print("Area of square is:", area)
5. Calculate simple interest
(P * N * R) / 100
Day 2 - Decision Making & Loops
if condition:
code to execute if condition is true
line 2
line 3
line 4
else:
code to execute if condition is false
Enter any number: 0
No is neither positive nor negative
if condition1:
code to execute if condition1 is true
elif condition2:
code to execute if condition1 is false and condition2 is true
elif condition3:
code to execute if condition1 and condition2 are false and condition3 is true
else:
code to execute when no one condition is true
1. WAP to find maximum number between 2 numbers.
2. WAP to check if number is even or odd(use modulus(%) operator)
3. WAP to find if year is leap year or not.
4. WAP to find largest number among three numbers.
Enter first no:55
Enter second no:65
Second no is maximum.
First no is maximum.
Both are equals.
no1 = int(input("Enter first number:"))
no2 = int(input("Enter second number:"))
if no1 > no2:
print("First no is maximum.")
elif no2 > no1:
print("Second no is maximum.")
else:
print("Both are equals.")
Enter any no: 55
55 is odd.
55 - odd
54 - even
no = int(input("Enter any no: "))
if no % 2 == 0:
print(f"{no} is even.")
print(no, "is even.")
else:
print(f"{no} is odd.")
Jan - 11
Feb - 12
March - 1
April - 2
May - 3
June - 4
July - 5
Aug - 6
Sep - 7
October - 8
Nov - 9
Dec - 10
---------------------------
12 Months -
2 Parts month - Shukla Paksha, Krushna Paksha
12 * 30 = 360 + 5
15 days
if it divisible by 400 - leap
if it divisible by 100 - not leap
if it is divisible by 4 - leap
yes - 1996, 2000, 2001, 2004, 2008
no - 2100, 2200
year = int(input("Enter a year: "))
if year % 400 == 0:
print("Yes it is a leap year")
elif year % 100 == 0:
print("No it is not a leap year")
elif year % 4 == 0:
print("Yes it is a leap year")
else:
print("No it is not a leap year")
T and T = T
T and F = F
F and T = F
F and F = F
T or T = T
T or F = T
F or T = T
F or F = F
year = int(input("Enter a year: "))
if year % 400 == 0 or (year % 100 != 0 and year % 4 == 0):
print("Yes it is a leap year")
else:
print("No it is not a leap year")
4. WAP to find largest number among three numbers.
30 30 30
all are equals
no1 = int(input("Enter first number: "))
no2 = int(input("Enter second number: "))
no3 = int(input("Enter third number: "))
if no1 > no2 and no1 > no3:
print("no1 is the largest number")
elif no2 > no1 and no2 > no3:
print("no2 is the largest number")
elif no3 > no1 and no3 > no2:
print("no3 is the largest number")
elif no1 == no2 and no1 > no3:
print("no1 and no2 are the largest numbers")
elif no1 == no3 and no1 > no2:
print("no1 and no3 are the largest numbers")
elif no2 == no3 and no2 > no1:
print("no2 and no3 are the largest numbers")
else:
print("All numbers are equal")
Loops
To perform same operations repeatedly we use loop.
1. While
2. For
4 things are needed for loop program
1. From where to start - initialization
2. Where to reach - condition
3. Forward/Backward - step
4. Actual operation - operation
While Loop
initialization
while condition:
operation
step
1 2 3 4 5 6 7 8 9 10
print(end = " ")
10 9 8 7 6 ... 1
i = 1
while i <= 100:
print(i, end = ' ')
i = i + 2
for loop
for i in range(1, 11, 1):
range function is used to go from one value to next value with step.
range(start, end + 1, step)
for i in range(1, 11, 1):
print(i, end = ' ')
for i in range(1, 11):
print(i, end = ' ')
for i in range(10, 0, -1):
print(i, end = ' ')
Print nos from 1 to 100. Don't print no if it is divisible by 5.
1 2 3 4 6 7 8 9 11 12 ...97 98 99
continue keyword informs to skip further operation in loop and go for step.
for i in range(1, 101, 1):
if i % 5 == 0:
continue
print(i, end = ' ')
for i in range(1, 101, 1):
if i % 5 == 0 or i % 7 == 0:
continue
print(i, end = ' ')
break - breaks and exits from loop
for i in range(1, 101, 1):
if i % 10 == 0:
break
print(i, end = ' ')
print("End")
Assignments
1. WAP to print even numbers between 1 and 100.
2. WAP to print odd numbers between 1 and 100.
3. WAP to print numbers divisible by 5 and 7 between 1 and 1000.
4. WAP to print numbers divisible by 5 or 7 between 1 and 1000.
5. WAP to print multiplication table(1 to 10).
6. WAP to print following patterns
a.
*
**
***
****
*****
b.
*****
****
***
**
*
c.
*
* *
* * *
* * * *
* * * * *
Collections - List, Tuple, Dict, Set
Collection is a data structure which help to group multiple values under one
variable.
List: it is variable which stores values in sequence of indexes(0, 1, 2, ....)
We can iterate list using 2 ways
1. index
2. values(foreach)
#m = [45, 43, 44, 39, 47]
# Print first value
# print(m[-2])
#print(len(m))
#Print all values using for loop
# for i in range(len(m)):
# print(f"Subject {i+1} Marks: {m[i]}")
#Calculate total of marks
# total = 0
# for i in range(len(m)):
# total += m[i]
#print("Total Marks:", total)
# total = 0
# for x in m:
# total += x
# print("Total Marks:", total)
friends = []
[Link]("Ramesh")
Slicing
listname[startindex:(endindex + 1):step]
List is mutable - []
Tuple-()
Is collection which can not be modified, otherwise it is same as list - immutable.
Dict: It is collection which stores values in key:value format
{}
Set- {}
It is similar to list but cannot have same value more than once.
Day 4 - Functions, Modules, Exceptions, File Handling
Function:
Example -
1. Balance Check
2. Deposit
3. Withdraw
4. Transfer
4. Interest
Repeating same task (balance check)
function is block of code which performs specific task.
When function is written inside class then it is Method.
def functionname():
lines
def functionname(parameters):
lines
module is a python file which has collection of variables, function and classes.
To use function, variable or class from module we need to import it.
There are 2 ways to import
1. Import entire module(file)
import filename as f
2. Import specific class, function, variable from file
from filename import function_name
What are the operations we perform with file?
open
read
write
append
close
copy
delete
seek
rename
information of file
When we open file in 'w' mode then it checks if file exists; if exists then clears
and opens and if not then creates and opens.
OOPs - Class and Object
Object Oriented Programming - It is one way of coding.
Great Grand Father - 3 Feet Size Wall
Grand Father/Father - 1.25 Feet/9 Inch
We - 4/6 Inch
---------------------------------------
- Creation
- Maintain
- Destroy
Maintainance
---------------------------------------
with help of class and object
structure - collection of different elements and
functions to work on these elements.
class - it is a blueprint of object
student - 1. information and
2. operations
libraries - procedure oriented
function oriented
object oriented
procedure + object
Class - is blueprint of object.
It has collection of variables(data members) and methods(member methods) to operate
on variables.
Object is instance of class.
In python we write constructor with name __init__. It receives atleast one
parameter i.e. self.
self keyword represent current object.
We declare variable inside __init__ method.
__init__ is automatically called system itself when object is initialized.
Basic Concepts of OOPs
1. Data Abstraction
2. Encapsulation
3. Inheritance
4. Polymorphism
1. Logic Improve
a. Enthusiasm
b. Determination
c. Patience
Libraries
1. numpy
2. pandas
3. matplot, seaborn
4. scipy
5. scikit-learn
Notebook
Roadmap
Python
1. Paid Internship - MAANG companies
3-6-12 Internship
12 Lakh+
Coding Language + DSA strong + Leetcode problems
2. Paid Internship - Specific Stack
6-12 Months
5K - 25K
MERN, Data Analyst, DS, AI
3. Unpaid Internship
2-3 Month training + on job internship + hire
4. Learning Based Internship
Fees pay + Train + Work on project
5. Enroll + Recorded Lectures - Fees - Certificate
6. Pay and get certificate
YouTube, Udemy, Class.