Month 1 Python Detailed Study Guide (AI/ML
Roadmap)
1. What is Python?
Python is a high-level, interpreted, general-purpose programming language created by Guido van
Rossum in 1991. It is designed to be easy to read and write, making it one of the best languages for
beginners and professionals.
Why use Python? Simple syntax, huge community, thousands of libraries, cross-platform support,
and excellent support for AI, Machine Learning, Automation, Data Science, Web Development and
Cloud computing.
Where is Python used?
• AI & Machine Learning
• Data Science
• Web Applications (Django, Flask, FastAPI)
• Automation Scripts
• Cyber Security
• Robotics
• IoT
• Cloud & DevOps
• Game Development
How Python Works Internally
Source Code (.py) → Bytecode (.pyc) → Python Virtual Machine (PVM) → Output.
2. Installing Python
Download Python from the official website. During installation, select 'Add Python to PATH'. Verify
installation by running python --version in the terminal.
Install VS Code or PyCharm. Install Jupyter Notebook using: pip install notebook.
3. Variables
A variable stores data in memory. Python is dynamically typed, so you don't declare the data type.
Example:
name = 'Pankaj'
age = 28
salary = 60000
Where used? Storing user information, AI model parameters, application settings, API responses
and database values.
4. Data Types
int - Whole numbers (age, quantity).
float - Decimal values (price, probability).
str - Text (user name, chatbot message).
bool - True/False decisions.
list - Ordered collection.
tuple - Immutable collection.
dict - Key-value data.
set - Unique values.
AI Example: A dataset is usually stored as a list or DataFrame, while model settings are often
stored in dictionaries.
5. Operators
Arithmetic (+,-,*,/,%), Comparison (==, !=, >, <), Logical (and, or, not), Assignment (=, +=),
Membership (in), Identity (is).
Used in business rules, filtering datasets, model evaluation, login validation, and calculations.
6. Conditional Statements
Use if, elif and else to make decisions.
Example: If a customer's age is greater than or equal to 18, allow registration. AI models also make
decisions based on conditions.
7. Loops
For loop executes a block for every item in a collection. While loop repeats until a condition
becomes false.
Used for processing datasets, reading files, training AI models over many iterations (epochs), and
automation.
8. Functions
Functions are reusable blocks of code.
Benefits: Code reuse, readability, testing, modular design.
Example uses: Data cleaning function, API call function, model prediction function.
9. OOP
Concepts: Class, Object, Encapsulation, Inheritance, Polymorphism, Abstraction.
Where used: Large enterprise software, AI frameworks, reusable code architecture.
10. Exception Handling
Use try-except to prevent program crashes.
Real-world: Network failures, invalid user input, missing files, API errors.
11. File Handling
Read and write text, CSV, JSON, and Excel files.
AI projects commonly read datasets from CSV and JSON files before model training.
12. Mini Projects
1. Calculator
2. Student Management System
3. Contact Book
4. Expense Tracker
5. Password Generator
6. File Organizer
Daily Practice Plan
Week 1: Python basics and 20 coding exercises.
Week 2: Conditions, loops, and 25 exercises.
Week 3: Lists, tuples, dictionaries, sets, and 3 mini projects.
Week 4: OOP, files, exceptions, GitHub upload, and final projects.
Interview Questions
• Why is Python popular for AI?
• Difference between List and Tuple?
• What is a Dictionary?
• Difference between == and is?
• What are functions?
• Explain OOP concepts.
• What is exception handling?
End of Month Checklist
✓ Write Python programs confidently.
✓ Solve 100 coding problems.
✓ Complete at least 5 mini projects.
✓ Push code to GitHub.
✓ Be ready for NumPy and Pandas.