Introduction to Python
Table of Contents
In the last lesson, we learned how this Python course is organized on the Python Tutorials page. Now let’s start from zero and understand what Python means.
Let’s Clear This First
Python is not a snake here. 🐍 The name came from a comedy show called “Monty Python.” But that story comes later. For us, Python is a programming language.
What Is a Programming Language?
Simple — it is the language we use to talk to a computer.
We talk to our friend in our own language. We talk to our boss in a formal way. And to a computer? We use Python. That’s it. That’s the whole idea.
Why Does a Computer Need a Language?
Because a computer is actually quite dumb. Seriously. Very dumb.
We cannot just say, “Hey, do this work for me.” It won’t understand. We have to tell it clearly, step by step, exactly what to do. And the way we tell it — that is Python.
What Is Python Programming Language?
Two things:
- A set of rules — how to write things, how not to write things
- A program — that runs on our computer and reads what we wrote
We write instructions following the rules. The computer reads them. It does the work. It shows the result.
Look at this example:
print("Hello world")We type this, run it, and the computer will show:
Hello worldThat’s it. That’s all. This is Python.
Python Explained with a Real-Life Example
Think about making a cup of tea. What is the recipe?
- Boil water
- Add tea leaves
- Add sugar and milk
- Wait for 2 minutes
- Pour into a cup
A computer works exactly like this. We give it the recipe. It follows it exactly. Python is just the way we write that recipe. The only difference is — the computer is more obedient than anyone we know. Whatever we write, it will do exactly that. So we have to write it correctly. 😅
Where Is Python Used in Real Life?
| Work | Example |
|---|---|
| Websites | Instagram, YouTube use a lot of Python behind the scenes |
| Data Science / AI | Things like ChatGPT |
| Automation | Auto-sending messages, filling forms, sorting files |
| Small personal tools | Instead of Excel, our own small program |
Is Python Hard to Learn?
No. It is the easiest one. Truly.
In other languages, just to print “hello” we need 5-6 lines of setup. In Python, one line:
print("hello")That’s it. That is why people start with Python.
One Important Thing About Python
Python is not magic. It cannot read our mind. If we write a wrong instruction, it will do the wrong thing. And it will do it without complaining. So when we write code, let’s think before we write.
Next, we will learn about Why Learn Python so we can continue step by step.