Faysal Ahmed

This book teaches Python from the ground up — no prior programming experience required. You’ll start by setting up your environment and writing your first program, then build up through data types, control flow, functions, data structures, and object-oriented programming. Each chapter includes hands-on examples and a mini-quiz to reinforce learning.


Contents

Chapter 1: Getting Started with Python

Installing Python, running your first script, using the interactive shell, and understanding Python’s design philosophy.

Chapter 2: Variables, Data Types & Operators

Variables, naming rules, integers, floats, strings, booleans, arithmetic, comparison, and logical operators.

Chapter 3: Control Flow

Conditional statements (if/elif/else), for loops, while loops, range(), break, continue, and the match statement.

Chapter 4: Functions

Defining functions, parameters and arguments, return values, scope, lambda functions, and docstrings.

Chapter 5: Data Structures

Lists, tuples, sets, dictionaries, list comprehensions, and when to use each data structure.

Chapter 6: Strings & File I/O

String methods, f-strings, string formatting, reading and writing files, the with statement, and working with CSV data.

Chapter 7: Object-Oriented Programming

Classes and objects, instance attributes, methods, inheritance, dunder methods, and properties.

Chapter 8: Modules & Packages

The import system, standard library highlights, creating your own modules, pip, and virtual environments.

Chapter 9: Error Handling

Exceptions, try/except/else/finally, raising exceptions, creating custom exceptions, and debugging techniques.

Chapter 10: Working with Libraries & Next Steps

Popular third-party libraries, project structure, writing idiomatic Python, and resources for continued learning.

Quizzes

Test your knowledge with chapter quizzes (3 questions each), a mid-book quiz (5 questions), and a comprehensive final quiz (20 questions).