For Premium courses of Python, Data Science, AI , ML, Data analytics Contact : 7880-113-112
For Premium courses of Python, Data Science, AI , ML, Data analytics Contact : 7880-113-112
Chapters
Unit 1 - Fundamentals of Python
Unit 2 - Variables, & Data Types
Unit 3 - Operators in Python
Unit 4 - Built in Functions of Python
Unit 5 - Control Flow Statement
Unit 6 - Concept of Loops
Unit 7 - User Defined Functions
Unit 8 - Strings in Python
Unit 9 - List in Python
Unit 10 - Tuples Concept
Unit 11 - Dictionary in Python
Unit 12 - Set in Python
Unit 13 - Numpy Library
Unit 14 - Pandas Library
Unit 15 - Matplotlib Library
Unit 16 - Seaborn Library
For Premium courses of Python, Data Science, AI , ML, Data analytics Contact : 7880-113-112
Popular AI technologies and frameworks
built in Python
For Premium courses of Python, Data Science, AI , ML, Data analytics Contact : 7880-113-112
For Premium courses of Python, Data Science, AI , ML, Data analytics Contact : 7880-113-112
Python: less code, more power
Write a code to print Hello World
C
Java
public class Main { #include <stdio.h>
public static void main(String[] args) {
[Link]("Hello, World!"); int main() {
} printf("Hello, World!");
} return 0;
}
Python
print("Hello, World!")
For Premium courses of Python, Data Science, AI , ML, Data analytics Contact : 7880-113-112
Anaconda Navigator
Ye ek graphical software hai jahan se aap coding tools open karte ho,
environments manage karte ho, aur libraries install karte ho — bina complex
commands likhe.
Anaconda = Python + bahut saare data science tools + libraries ka ready-made
bundle.
Isme already milte hain:
• Python
• Jupyter Notebook
• Spyder
• VS Code
• NumPy, Pandas, Matplotlib, Scikit-learn etc.
Matlab alag alag install karne ka headache ka
For Premium courses of Python, Data Science, AI , ML, Data analytics Contact : 7880-113-112
Jupyter Notebook
Jupyter Notebook is an open-source web application that allows
you to create and share documents that contain live code,
equations, visualizations, and narrative text.
It's commonly used for data cleaning and transformation, numerical
simulation, statistical modeling, data visualization, machine
learning, and much more.
One of the key features of Jupyter Notebook is its interactivity,
which allows you to run code in a step-by-step manner, making it
excellent for exploratory data analysis and interactive computing.
For Premium courses of Python, Data Science, AI , ML, Data analytics Contact : 7880-113-112
Unit 2 - Variables & Operators
Data types - Example - e-commerce company Customer Data
For Premium courses of Python, Data Science, AI , ML, Data analytics Contact : 7880-113-112
Unit 2 - Variables & Operators
For Premium courses of Python, Data Science, AI , ML, Data analytics Contact : 7880-113-112
Unit 2 - Variables & Operators
Variables in Python
Variables in Python are like containers that hold data values. When you assign
a value to a variable, you're essentially putting that value into the container.
In Python, variables are used to store data values. They are created when you
assign a value to them using the assignment operator (=)
For Premium courses of Python, Data Science, AI , ML, Data analytics Contact : 7880-113-112
Unit 2 - Variables & Operators
# Rules for Python variables: Variables in Python
• A variable name must start with a letter or the underscore character
• A variable name cannot start with a number
• A variable name can only contain alpha-numeric characters
and underscores (A-z, 0-9, and _ )
• Variable names are case-sensitive (age, Age and AGE are three
• different variables)
• A variable name cannot be any of the Python keywords.
For Premium courses of Python, Data Science, AI , ML, Data analytics Contact : 7880-113-112
Unit 2 - Variables & Operators
Practice Question 1
Which of the following is a valid variable name in Python?
A) myVariable123
B) 123variable
C) variable-abc
D) my variable
For Premium courses of Python, Data Science, AI , ML, Data analytics Contact : 7880-113-112
Unit 2 - Variables & Operators
Practice Question 2
Which of the following is a correct way to comment a single line in Python?
A) / This is a comment
B) # This is a comment
C) /* This is a comment */
D) // This is a comment
For Premium courses of Python, Data Science, AI , ML, Data analytics Contact : 7880-113-112
Unit 3 – Built in Functions
Why we need functions in python?
We need functions in Python for a few reasons:
Reuse of Code : Functions allow us to write a block of code once and use it
multiple times in our program. Instead of repeating the same code, we can
call the function whenever we need that functionality.
Organization : Functions help to organize our code into smaller,
manageable pieces. Each function can represent a specific task or action,
making the overall program easier to understand and maintain.
For Premium courses of Python, Data Science, AI , ML, Data analytics Contact : 7880-113-112
Unit 3 – Built in Functions
Types of functions in python
For Premium courses of Python, Data Science, AI , ML, Data analytics Contact : 7880-113-112
Unit 3 – Built in Functions
Practice Question - 3
Which built-in Python function is used to find the length of an iterable object?
A) length()
B) count()
C) size()
D) len()
For Premium courses of Python, Data Science, AI , ML, Data analytics Contact : 7880-113-112
Unit 3 – Built in Functions
Practice Question - 4
Which built-in Python function is used to find the length of an iterable object?
A) length()
B) count()
C) size()
D) len()
For Premium courses of Python, Data Science, AI , ML, Data analytics Contact : 7880-113-112
Unit 4 – Control Flow Statement
Online Shopping Discount System
• If the order value is 1000 or less, no discount will be given.
• If the order value is between 1001 and 5000, a 10% discount will be applied.
• If the order value is more than 5001, a 20% discount will be applied.
For Premium courses of Python, Data Science, AI , ML, Data analytics Contact : 7880-113-112
Unit 4 – Control Flow Statement
Control flow statements in Python are instructions that determine the order in which code is executed
based on certain conditions or loops. They allow you to control the flow of execution within a program,
deciding which blocks of code to execute and when to execute them.
For Premium courses of Python, Data Science, AI , ML, Data analytics Contact : 7880-113-112
Unit 5 – Concept of Loops
In Python, loops are control structures used to execute a block of code repeatedly
until a certain condition is met. They allow you to automate repetitive tasks
Calculating Total Sales: Suppose you have a list of sales amounts for each day of the
week, and you want to calculate the total sales for the week. You can use a loop to
iterate through the list of sales amounts and accumulate the total.
Data Cleaning:
Suppose you have a list of strings representing sentences, and you want to remove
any punctuation marks from each sentence. You can use a loop to iterate through the
list, remove punctuation from each sentence, and store the clean sentences in a new
list.
For example, if we want to show a message 100 times, then we can use a loop. A loop
statement allows us to execute a statement or group of statements multiple times.
For Premium courses of Python, Data Science, AI , ML, Data analytics Contact : 7880-113-112
Unit 5 – Concept of Loops
For Premium courses of Python, Data Science, AI , ML, Data analytics Contact : 7880-113-112
Unit 5 – Concept of Loops
For Loop
The for loop in Python is indeed used to iterate over sequences such as lists, tuples, strings, dictionaries,
and ranges. It allows you to execute a block of code for each item in the sequence.
For Premium courses of Python, Data Science, AI , ML, Data analytics Contact : 7880-113-112
Unit 5 – Concept of Loops
While Loop
In python, a while loop is used to execute a block of statements repeatedly until a given condition is
satisfied. And when the condition becomes false, the line immediately after the loop in the program is
executed.
For Premium courses of Python, Data Science, AI , ML, Data analytics Contact : 7880-113-112
Unit 6 – User Defined Functions
What are user-defined functions in Python?
Functions that we define ourselves to do certain specific task
are referred as user-defined [Link] the functions that are written by
any us comes under the category of user defined functions.
A function is a reusable block of programming statements designed to
perform a certain task.
For Premium courses of Python, Data Science, AI , ML, Data analytics Contact : 7880-113-112
Unit 6 – User Defined Functions
Advantages of user-defined functions
• User-defined functions help to decompose a
large program into small segments which
makes program easy to understand,
maintain and debug.
• If repeated code occurs in a program.
Function can be used to include those codes
and execute when needed by calling that
function.
• Programmars working on large project can
divide the workload by making different
functions.
For Premium courses of Python, Data Science, AI , ML, Data analytics Contact : 7880-113-112
Unit 6 – User Defined Functions
Creating a Function
In Python a function is defined using the def keyword:
Example
def abc():
print("Hello from a function")
For Premium courses of Python, Data Science, AI , ML, Data analytics Contact : 7880-113-112
Unit 6 – User Defined Functions
Calling a Function
To call a function, use the function name followed by parenthesis:
Example
def abc():
print("Hello from a function")
abc()
For Premium courses of Python, Data Science, AI , ML, Data analytics Contact : 7880-113-112
Unit 7 – Strings in Python
What are Strings?
In Python, a string is a sequence of characters enclosed within quotes. Strings in
Python are sequences of characters used to represent [Link] can include letters,
numbers, symbols, and spaces.
For Premium courses of Python, Data Science, AI , ML, Data analytics Contact : 7880-113-112
Unit 7 – Strings in Python
Indexing of Strings
Indexing in strings refers to accessing individual characters in a string using their position
(index). Python uses zero-based indexing, meaning the first character of a string has an
index of 0, the second character has an index of 1, and so on. Negative indexing can also
be used to access characters from the end of the string, where -1 is the last character, -2
is the second last, and so forth.
For Premium courses of Python, Data Science, AI , ML, Data analytics Contact : 7880-113-112
Unit 7 – Strings in Python
Slicing of Strings
Slicing in Python allows you to extract a part of a string (substring) using a range of
indices. This is done using the slicing operator, which is a colon : inside square brackets [].
For Premium courses of Python, Data Science, AI , ML, Data analytics Contact : 7880-113-112
Unit 12 – Numpy Library
Numpy (Numerical Python) ek bahut hi
powerful Python library hai jo mukhya roop se
mathematical calculations aur data
manipulation ke liye use ki jati hai. Agar aap
Data Science, Machine Learning ya AI seekhna
chahte hain, toh Numpy uska base hai.
For Premium courses of Python, Data Science, AI , ML, Data analytics Contact : 7880-113-112
Unit 12 – Numpy Library
N-dimensional Arrays (ndarray): Numpy ka sabse bada
feature iska "Array" hai. Ye Python ki lists jaisa hi dikhta hai,
lekin ye 1D (vector), 2D (matrix), ya usse zyada dimensions
mein data handle kar sakta hai.
Speed aur Efficiency: Numpy arrays Python lists se kahin
zyada fast hote hain kyunki ye memory mein lagatar
(contiguous) store hote hain aur C language mein optimize
kiye gaye hain.
Mathematical Functions: Isme linear algebra, Fourier
transform, aur random number generation ke liye inbuilt
functions hote hain.
Broadcasting: Ye ek aisa feature hai jo alag-alag shapes ke
arrays par mathematical operations karne ki permission deta
hai.
For Premium courses of Python, Data Science, AI , ML, Data analytics Contact : 7880-113-112
Courses of
AI & Data Science, Data Analytics
Contact us - 7880113112
For Premium courses of Python, Data Science, AI , ML, Data analytics Contact : 7880-113-112
Connect with us
Instagram Handle
theiscale
The iScale Organization Handle
[Link]
Siblings - Nishant Dhote & Swati Dhote
For Premium Courses of AI & Data Science, Contact us - 7880113112
Website – [Link] Contact : 7880-113-112 theiscale [Link]
Practice Questions
Unit 2: Variables & Data Types
Q: Swap two variables
A: a,b=10,20 a,b=b,a print(a,b)
Q: Check datatype
A: x=input() print(type(x))
Q: Convert float to int
A: x=10.5 print(int(x))
Q: Sum of two floats
A: a=float(input()) b=float(input()) print(a+b)
Q: Multiple assignment
A: a=b=c=5 print(a,b,c)
Unit 3: Operators
Q: Even or odd
A: n=int(input()) print(n%2==0)
Q: Largest of 3
A: print(max(1,5,3))
Q: Divisible by 5 and 11
A: n=int(input()) print(n%5==0 and n%11==0)
Q: Power
A: print(2**3)
Q: Bitwise AND
A: print(5&3)
Unit 4: Built-in Functions
Q: Length
A: print(len('hello'))
Q: Sum
A: print(sum([1,2,3]))
Q: Max
A: print(max([1,5,3]))
Q: Sort
A: print(sorted([3,1,2]))
Q: Type casting
A: print(str(10))
Unit 5: Control Flow
Q: Positive or negative
A: n=int(input()) print('Positive' if n>0 else 'Negative')
Q: Grade
A: marks=80 print('A' if marks>=75 else 'B')
Q: Leap year
A: year=2024 print(year%4==0)
Q: Nested if
A: x=10 if x>5: if x<15: print('OK')
Q: Vowel check
A: ch='a' print(ch in 'aeiou')
Unit 6: Loops
Q: Print 1-10
A: for i in range(1,11): print(i)
Q: Sum n numbers
A: n=5 print(sum(range(1,n+1)))
Q: Reverse number
A: n=123 print(str(n)[::-1])
Q: Factorial
A: f=1 for i in range(1,6): f*=i print(f)
Q: While loop
A: i=1 while i<=5: print(i) i+=1
Unit 7: Functions
Q: Simple function
A: def f(): print('Hi') f()
Q: Add function
A: def add(a,b): return a+b print(add(2,3))
Q: Default arg
A: def f(x=10): print(x) f()
Q: Lambda
A: sq=lambda x:x*x print(sq(4))
Q: Recursion
A: def fact(n): return 1 if n==1 else n*fact(n-1) print(fact(5))
Unit 8: Strings
Q: Reverse string
A: s='hello' print(s[::-1])
Q: Count vowels
A: s='hello' print(sum(1 for i in s if i in 'aeiou'))
Q: Uppercase
A: print('hi'.upper())
Q: Palindrome
A: s='madam' print(s==s[::-1])
Q: Replace
A: print('hi'.replace('h','y'))
Unit 9: Lists
Q: Append
A: l=[1,2] [Link](3)
Q: Remove
A: l=[1,2,3] [Link](2)
Q: List comprehension
A: [i*i for i in range(5)]
Q: Max
A: print(max([1,5,3]))
Q: Reverse
A: l=[1,2,3] [Link]()
Unit 10: Tuples
Q: Create tuple
A: t=(1,2,3)
Q: Access
A: print(t[1])
Q: Count
A: print([Link](2))
Q: Convert
A: tuple([1,2])
Q: Unpacking
A: a,b=(1,2)
Unit 11: Dictionary
Q: Create
A: d={'a':1}
Q: Access
A: print(d['a'])
Q: Add key
A: d['b']=2
Q: Loop
A: for k,v in [Link](): print(k,v)
Q: Get
A: print([Link]('a'))
Unit 12: Set
Q: Create
A: s={1,2,3}
Q: Add
A: [Link](4)
Q: Remove
A: [Link](2)
Q: Union
A: print({1,2}|{2,3})
Q: Intersection
A: print({1,2}&{2,3})
Unit 13: NumPy
Q: Array
A: import numpy as np [Link]([1,2,3])
Q: Shape
A: arr=[Link]([1,2,3]) print([Link])
Q: Zeros
A: [Link]((2,2))
Q: Mean
A: [Link]([1,2,3])
Q: Add
A: arr+5
Unit 14: Pandas
Q: DataFrame
A: import pandas as pd df=[Link]({'A':[1,2]})
Q: Head
A: [Link]()
Q: Column
A: df['A']
Q: Describe
A: [Link]()
Q: Filter
A: df[df['A']>1]
Unit 15: Matplotlib
Q: Line plot
A: import [Link] as plt [Link]([1,2],[3,4]);[Link]()
Q: Title
A: [Link]('Graph')
Q: Labels
A: [Link]('X');[Link]('Y')
Q: Bar
A: [Link]([1,2],[3,4])
Q: Hist
A: [Link]([1,2,2,3])
Unit 16: Seaborn
Q: Load dataset
A: import seaborn as sns df=sns.load_dataset('tips')
Q: Scatter
A: [Link](x='total_bill',y='tip',data=df)
Q: Boxplot
A: [Link](x='day',y='total_bill',data=df)
Q: Heatmap
A: [Link]([Link]())
Q: Pairplot
A: [Link](df)