Introduction
Since the dawn of the twenty-first century, we have witnessed an immense digital surge, ushering in a new technological era that complements the digital revolution which began in the mid-twentieth century with the first appearance of the computer. This new era is characterized by advanced, intelligent electronic applications that invade our lives, expand into every aspect of them, and take root—parallel to a qualitative leap in the field of smart mobile devices, now accessible to everyone and spreading among the peoples of the earth like wildfire.
This new technological era—the era of smart devices and applications—has left a profound and far-reaching impact on our modern lifestyle, making it easier on multiple levels. For instance, who among us does not use the WhatsApp application and even rely on it for many daily tasks? Whether for chatting with family and friends or for work and communication with clients… The same question applies to many other applications that have permeated our lives and claimed a significant share of them—from Google and its ease of access to information, to Facebook and Twitter and the social media revolution, to ChatGPT and Gemini and the surge of artificial intelligence… and many more applications whose role and influence have grown so immense that they have become an urgent daily necessity and a way of life that is hard to abandon.
The deep impact this era has left on various aspects of our lives is a clear indication of the tremendous importance of the sciences that this great technology has brought us—namely, computing sciences. In this book, we will explore one essential and fascinating branch of these sciences: programming.
To further illustrate the significance of programming and its pivotal role in this age, let us consider this example and imagine what might happen if—for some reason—all software systems in a given country were to fail:
Such a grim scenario would likely lead to the following: government offices grinding to a halt, citizens unable to complete transactions, internet service collapsing, wireless communications failing, banks, factories, companies, airplanes, and high-speed trains ceasing to operate, and so on… In short, it would be a catastrophic scenario akin to life coming to a standstill.
In the digital age we live in, most operations depend fundamentally and critically on computing technology and programming. Consequently, programming has become a vital, indispensable necessity of our time.
This immense importance of programming has led to an enormous surge in demand for it, placing programming-related jobs at the forefront of the labor market. Learning this skill has become a golden opportunity to secure employment—not just any employment, but highly rewarding positions with generous pay, whether as permanent roles in companies or as freelance work that can be done from home.
So, if you are among those looking to seize this great opportunity to boost your income by learning an enjoyable and not overly demanding skill, and you are wondering where and how to begin, this book is your gateway to achieving that—through learning the wonderful programming language Python.
Who This Book Is For
This book is for anyone who wants to learn programming with Python from the ground up—students, self-learners, and professionals building new skills or preparing for a career change. No prior programming experience is required, and you don’t need advanced math—basic computer skills, curiosity, and a bit of practice are enough. If you’re completely new to coding (or you’ve tried before and felt stuck), this book is designed to guide you toward writing your own programs with confidence.
What is Python? And why did I choose it in this book as an entry point into the world of programming?
Python is a widely renowned programming language developed by the brilliant Dutch programmer Guido Van Rossum, who named it “Python” after the famous comedy series Monty Python’s Flying Circus. The first version of this language was released in 1991, and it has grown tremendously to become one of the most popular and widely used programming languages in the world.
Why Python?
With hundreds of programming languages available, the first question that may come to mind for someone deciding to learn programming is: “Which programming language should I choose?” My answer is: “Choose Python without hesitation,” for many reasons, including:
• Ease of learning combined with powerful performance: Python is a smooth, easy-to-learn language, ideal for beginners, while also being extremely powerful and highly efficient for use in complex and advanced fields. For example, it is used in advanced research at NASA.
• High demand and lucrative returns: Python is among the most sought-after and widely used programming languages. It is employed by major global companies such as Google, Facebook, Instagram, YouTube, Amazon, Uber… Moreover, it ranks among the highest-paying programming languages. For instance, according to Glassdoor, the average annual salary for a Python programmer in the United States ranges from $80,000 to $120,000.
• Compatibility with different operating systems and versatility of use: Python is compatible with most well-known operating systems, such as iOS, Android, Linux, macOS, Windows, and others. This powerful language also boasts a wide range of applications—from automation to statistical and data sciences, to artificial intelligence, to web development, to game development, and more… along with many other reasons that make Python our language of choice.
I now place in your hands this comprehensive book covering most of Python’s fundamentals, written in a simple, fluid style that is easy for both young and old to understand. I have structured it in a semi-interactive manner, including code samples alongside their execution results, and enriched it with detailed, abundant explanations—similar to student notes—so that readers can learn independently without needing additional lessons or training courses. I have organized its topics in a flexible, systematic progression1, dividing it into two parts:
Part One: Fundamentals—distributed across nine essential chapters, accompanied by practice exercises.
1 The reader may notice a similarity between the sequence of this book’s chapter titles and those of Python Crash Course. That book had a significant impact on me and served as my entry point into the world of Python many years ago.
Part Two: Practical Applications—consisting of five projects for hands-on experience in building programs and applications, which include, in sequence:
And I have equipped this comprehensive book, which covers most of the fundamentals of Python, with a detailed Table of Contents that can serve as a dictionary for this powerful, elegant, and easy-to-learn language.
Ahmed Al-Khatib