Your first line of code,
the start of an adventure.
With An Adventure with Python, start from zero,
build real projects and grow one step at a time.
The English edition is coming soon.

From the first step onward
Learn by building
Find your own solutions
A clear path forward

Games, tools, reports;
made with your code.
Every chapter gives you something to build, test and make your own.
- Chapter 01
Build a digital business card
Set up Python or Google Colab and write your first program by displaying text.
print() / Colab - Chapter 02
Hunt bugs in cursed code
Find the errors in a program, investigate step by step and get it running.
Debugging - Chapter 03
Build a magic calculator
Use variables, data types and operators to calculate the spoils of your adventure.
Variables / Operators - Chapter 04
The great number guessing game
A hidden number, a few guesses and hints from your program: build a game with conditions and loops.
if / while - Chapter 05
Manage your adventurer’s backpack
Keep your loot in lists, add and remove items, and explore your backpack with a for loop.
Lists / for - Chapter 06
The adventurers’ hall of fame
Use slicing, tuples and sorting to turn adventurer records into a leaderboard.
Slicing / Tuples - Chapter 07
Build a word translator
Store words as keys and values in a dictionary and look up their translations.
Dictionary - Chapter 08
Clean up cursed code
Define functions with inputs, return values and defaults to reduce repetition.
Functions / return - Chapter 09
Build a password generator
Practice import, random and loops in this educational password-generation project.
import / random - Chapter 10
Analyze an ancient scroll
Process text, practice formatting and count the words in your scroll.
Strings / f-strings - Chapter 11
Create a bestiary
Save information in files and JSON, handle errors and work with Persian text.
Files / JSON - Chapter 12
Build a wizard shop
Define the shop’s inventory and behavior with classes and objects.
Class / Object - Chapter 13
Organize your wizard shop
Split your shop into files and modules to give the program a clearer structure.
Modules - Chapter 14
Build a deadline reminder
Work with dates, times and durations to create a deadline reminder.
datetime - Chapter 15
List alchemy
Explore Pythonic tools including enumerate, zip, list comprehensions and lambda expressions.
Comprehensions / Lambda - Chapter 16
The adventurer’s mission journal
Bring your skills together in a complete program for recording, saving and managing missions.
OOP / JSON - Chapter 17
Create a magic noticeboard
Set up a virtual environment, install packages and manage dependencies with pip and requirements.
pip / venv - Chapter 18
The million-adventurer challenge
Explore arrays and vectorized operations, then compare calculation speeds.
NumPy - Chapter 19
Analyze the scoreboard
Read CSV and Excel data, filter DataFrames and build reports.
Pandas / CSV - Chapter 20
The guild’s visual report
Turn data into charts and create a visual report with Matplotlib.
Matplotlib
Write code. Earn XP. Level up.
Start at level 1, rank H. Projects and side missions earn you XP as you advance through the book. Reach rank S and level 100 in chapter 21: the book’s Legendary Programmer.
- HLevel 2Chapter 1
- GLevel 3Chapter 2
- FLevel 10Chapter 4
- ELevel 35Chapter 9
- DLevel 60Chapter 12
- CLevel 75Chapter 15
- BLevel 80Chapter 16
- ALevel 99Chapter 20
- SLevel 100Chapter 21
Pack your skills;
the path is here.
Seven connected parts take you from Python basics to a complete project and your first steps with data.
Learn a concept.
Use it in a mission.
01Part 1 · Chapters 1–4Start your adventure!
Set up your environment, write your first program, solve problems and use variables, conditions and while loops.
- Chapter 1
Your first step: set up your development environment
Project: Build a digital business card - Chapter 2
Become a code detective
Project: Hunt bugs in cursed code - Chapter 3
Magic boxes: the magic calculator
Project: Build a magic calculator - Chapter 4
Logic and conditions: build a number guessing game
Project: The great number guessing game
02Part 2 · Chapters 5–9Manage your adventurer’s backpack
Explore lists, slicing, tuples, sorting, dictionaries, functions and libraries.
- Chapter 5
The magic backpack: manage your loot
Project: Manage your adventurer’s backpack - Chapter 6
Backpack secrets: the adventurers’ hall of fame
Project: The adventurers’ hall of fame - Chapter 7
The magic book: build a word translator
Project: Build a word translator - Chapter 8
Create your own spells: the art of functions
Project: Clean up cursed code - Chapter 9
A protective spell: generating passwords
Project: Build a password generator
03Part 3 · Chapters 10–12Enter the fourth dimension
Process text, work with files and JSON, handle errors and discover object-oriented programming.
- Chapter 10
Decode ancient scrolls: a text analyzer
Project: Analyze an ancient scroll - Chapter 11
An anti-forgetting spell: working with files
Project: Create a bestiary - Chapter 12
Bring code to life with objects
Project: Build a wizard shop
04Part 4 · Chapters 13–15Rituals of the senior wizard
Work with modules, dates and times, enumerate, zip, list comprehensions and lambda expressions.
- Chapter 13
The separation spell: a place for every piece of code
Project: Organize your wizard shop - Chapter 14
The magic book of time
Project: Build a deadline reminder - Chapter 15
The Python tribe: the art of Pythonic code
Project: List alchemy
05Part 5 · Chapter 16The final battle: your big project
Combine what you have learned in the complete adventurer’s mission journal project.
- Chapter 16
The final battle: build your mission journal
Project: The adventurer’s mission journal
06Part 6 · Chapters 17–20Enter the hall of seers
Take your first steps with data: pip and venv, NumPy, Pandas and Matplotlib.
- Chapter 17
The summoning gate and magic laboratory
Project: Create a magic noticeboard - Chapter 18
NumPy spells: fast numerical computing
Project: The million-adventurer challenge - Chapter 19
The great Pandas library: tabular data
Project: Analyze the scoreboard - Chapter 20
Magic charts with Matplotlib
Project: The guild’s visual report
07Part 7 · Chapter 21The adventure continues…
Explore specialist paths and choose your next step in learning Python.
- Chapter 21
Endless horizons: your next treasure maps
Choose your next path; no new main project
Meet your next adventure companion.
Explore the English edition’s real table of contents, from your first program to data projects and the road ahead.
Zoom inAn Adventure with Python:
a project-based start from zero
Written by Mohammad Mahdi Ghaemi, this book introduces programming from the beginning. Across 7 parts and 21 chapters, you progress from setting up your environment to files, objects and basic data tools. The Persian edition is published by Kian University Press; the English edition is coming soon.
- Clear explanations, practical examples and project code
- Side missions with solutions
- A complete project to bring your skills together

“In this book, we are fellow travelers.”
Discover new ideas, build something with them and grow more independent with every experiment.
You might be wondering.
Is this book suitable for complete beginners?
Yes. It starts with setting up your environment, running your first line of code and understanding what programming means. Each chapter builds on the previous ones.
Can I start on a phone or tablet?
You can start with Google Colab in your browser, as explained in the book. A computer is more comfortable for longer coding sessions and projects.
Does the book include exercises and projects?
Yes: 20 main projects and 90 side missions. Read the example, write and run it yourself, then rebuild it without looking. Solutions help you compare approaches.
Will I learn data analysis and AI?
Part 6 introduces NumPy, Pandas and Matplotlib for working with data and charts. It provides a foundation for further study, rather than a complete or advanced AI course.
When can I buy the English edition?
The English edition has not been published yet. It is coming soon; a release date and purchase links will be added here when available. The Persian edition is available from Kian University Press and Fidibo.
Coming soon.
The English edition has not been published yet. Release details and purchase links will appear here when it is available.