Python Complete Notes: Beginner to Advanced
This guide explains Python step■by■step with simple explanations and practical examples. It is designed for
beginners who want to progress to advanced concepts.
1. What is Python?
Python is a high-level programming language known for its simplicity and readability.
It is widely used in:
• Web development
• Data science
• Artificial intelligence
• Automation
• Embedded systems
Python is beginner■friendly because its syntax is easy to read and write.
Example:
print("Hello World")
2. Installing Python
Steps:
1. Download Python from [Link]
2. Install it on your system
3. Use an editor such as VS Code, Thonny, or PyCharm
4. Run programs using the terminal or IDE
Example:
# first python program
print("Python installed successfully!")
3. Variables
Variables store data in memory. Python automatically determines the variable type.
Example:
name = "Praveen"
age = 21
height = 5.9
print(name)
print(age)
print(height)
4. Data Types
Common data types:
• int
• float
• string
• boolean
• list
• tuple
• dictionary
Example:
a = 10
b = 3.5
c = "Python"
d = True
print(type(a))
print(type(c))
5. Operators
Operators perform operations on values.
Types:
Arithmetic: + - * / %
Comparison: == != > <
Logical: and or not
Example:
a = 10
b = 5
print(a + b)
print(a * b)
print(a > b)
print(a > 3 and b < 10)
6. Conditional Statements
Conditional statements allow the program to take decisions.
Example:
marks = 75
if marks >= 90:
print("Grade A")
elif marks >= 60:
print("Grade B")
else:
print("Grade C")
7. Loops
Loops repeat a block of code.
Types:
• for loop
• while loop
Example:
# for loop
for i in range(5):
print(i)
# while loop
x = 0
while x < 5:
print(x)
x += 1
8. Functions
Functions group reusable code.
Example:
def greet(name):
print("Hello", name)
greet("Praveen")
9. Lists
Lists store multiple values in one variable.
Example:
numbers = [1,2,3,4]
[Link](5)
for n in numbers:
print(n)
10. Tuples
Tuples are similar to lists but immutable.
Example:
data = (10,20,30)
print(data[0])
11. Dictionaries
Dictionaries store key-value pairs.
Example:
student = {
"name":"Praveen",
"age":21,
"branch":"ECE"
}
print(student["name"])
12. String Operations
Strings support many useful methods.
Example:
text = "python programming"
print([Link]())
print([Link]())
print([Link]("python","PYTHON"))
13. File Handling
Python can read and write files.
Example:
file = open("[Link]","w")
[Link]("Hello Python")
[Link]()
14. Exception Handling
Used to prevent program crashes.
Example:
try:
a = 10/0
except ZeroDivisionError:
print("Cannot divide by zero")
15. Object Oriented Programming
OOP helps structure large programs.
Concepts:
• Class
• Object
• Inheritance
• Encapsulation
Example:
class Student:
def __init__(self,name):
[Link] = name
def display(self):
print([Link])
s1 = Student("Praveen")
[Link]()
16. Inheritance
Inheritance allows one class to inherit properties from another.
Example:
class Animal:
def speak(self):
print("Animal speaks")
class Dog(Animal):
pass
d = Dog()
[Link]()
17. Modules
Modules allow code reuse by importing files.
Example:
import math
print([Link](25))
18. Working with Libraries
Python has powerful libraries:
NumPy – numerical computing
Pandas – data analysis
Matplotlib – visualization
TensorFlow – AI
Example:
import math
print([Link](5))
19. Simple Project: Calculator
This is a beginner Python project.
Example:
a = int(input("Enter first number: "))
b = int(input("Enter second number: "))
print("Addition:", a+b)
print("Subtraction:", a-b)
print("Multiplication:", a*b)
print("Division:", a/b)
20. Next Learning Paths
After learning Python you can explore:
• Web Development (Flask, Django)
• Data Science
• Machine Learning
• Automation
• Embedded Python for microcontrollers
Example:
print("Practice Python daily!")