Python Full Beginner Course
This course is designed for complete beginners who want to learn Python from scratch. It covers basics, logic
building, functions, object-oriented programming, file handling, and mini projects.
1. Introduction to Python
Python is a popular programming language used in AI, web development, automation, data science, and game develo
Why Python?
- Easy syntax
- Beginner friendly
- Huge community
- Used in AI/ML and automation
Install Python from [Link] and use VS Code or PyCharm for coding.
2. Your First Program
Example:
print("Hello World")
print() is used to display output on the screen.
3. Variables and Data Types
Variables store data.
Example:
name = "Alex"
age = 18
height = 5.8
is_student = True
Main data types:
- str
- int
- float
- bool
4. User Input
Example:
name = input("Enter your name: ")
print("Hello", name)
Convert input using int() or float() when needed.
5. Operators
Arithmetic Operators:
+ - * / // % **
Comparison Operators:
== != > < >= <=
Logical Operators:
and or not
6. Conditional Statements
Example:
age = 18
if age >= 18:
print("Adult")
else:
print("Minor")
7. Loops
For Loop Example:
for i in range(5):
print(i)
While Loop Example:
count = 1
while count <= 5:
print(count)
count += 1
8. Lists
Example:
fruits = ["apple", "banana", "mango"]
print(fruits[0])
Useful methods:
append(), remove(), sort()
9. Tuples, Sets, Dictionaries
Tuple:
nums = (1,2,3)
Set:
nums = {1,2,3}
Dictionary:
student = {"name":"Alex", "age":18}
10. Functions
Functions help reuse code.
Example:
def greet(name):
print("Hello", name)
greet("Alex")
11. Object Oriented Programming
Example:
class Student:
def __init__(self, name):
[Link] = name
def show(self):
print([Link])
s1 = Student("Alex")
[Link]()
12. File Handling
Write File:
file = open("[Link]", "w")
[Link]("Hello")
[Link]()
Read File:
file = open("[Link]", "r")
print([Link]())
13. Exception Handling
Example:
try:
x = 10 / 0
except ZeroDivisionError:
print("Cannot divide by zero")
14. Modules and Libraries
Import modules using import.
Example:
import math
print([Link](25))
15. Python for AI and Data Science
Popular libraries:
- NumPy
- Pandas
- Matplotlib
- Scikit-learn
- TensorFlow
16. Mini Projects
Ideas:
- Calculator
- Number Guessing Game
- To-Do List
- Student Management System
17. Practice Tips
Practice daily.
Build small projects.
Solve coding questions.
Learn debugging and problem solving.
18. Python Interview Questions
1. What is Python?
2. Difference between list and tuple?
3. What is a function?
4. Explain OOP.
5. What are modules?
Final Notes
Congratulations! You completed the Python beginner course. Next steps: - Learn DSA (Data Structures & Algorithms)
- Build projects - Explore AI/ML and Data Science - Practice on coding websites