python › Introduction
phoolchandra · Oct 23, 2026 · Published
Python is the language behind YouTube's backend, Instagram, Netflix recommendations, ChatGPT-style AI research and millions of automation scripts. It is also the most recommended first programming language in the world. In this blog you will understand what Python is, why it is so popular, how it runs your code, and what you will learn in this complete Python series.
Watch the video first, then use this blog as your notes. Every section has runnable examples, and at the end you will find a "Predict the Output" quiz, practice challenges, a self-check list, interview questions and a quick summary.
How to use this blog: Open the Python shell (type python in your terminal) or any online Python editor and type every example yourself. Change the values, break the code and see what happens — that is how concepts really stick.
Python is a high-level, interpreted, general-purpose programming language known for its simple, English-like syntax. You write less code, and the code is easy to read even months later.
| Fact | Detail |
|---|---|
| Created by | Guido van Rossum (Netherlands) |
| First released | 1991 |
| Name inspired by | The British comedy show Monty Python's Flying Circus — not the snake! |
| Managed by | Python Software Foundation (PSF) |
| License | Free and open source |
| Current major version | Python 3 (Python 2 reached end-of-life on 1 January 2020) |
| File extension | .py |
Here is the classic "Hello, World!" program in three languages:
C
#include <stdio.h>
int main() {
printf("Hello, World!\n");
return 0;
}Java
public class Main {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}Python
print("Hello, World!")One line! That is why beginners love Python — you focus on solving the problem, not on the syntax.
Python is usually called an interpreted language, but internally it works in two steps:
hello.py ---> [ Compiler ] ---> Bytecode (.pyc) ---> [ PVM ] ---> Output
(source) (platform independent) (interpreter)| Compiled language (C, C++) | Interpreted language (Python) |
|---|---|
| Whole program is converted to machine code before running | Code is executed line by line by the interpreter |
| Usually faster at runtime | Slightly slower, but much faster to write and test |
| Errors shown after compiling the whole program | Program stops at the first line that has an error |
| Executable depends on the OS | Same .py file runs on any OS with Python installed |
Did you know?: The standard Python you download from python.org is called CPython because the interpreter itself is written in C. Other implementations include PyPy (faster), Jython (Java) and MicroPython (microcontrollers).
| Field | Popular libraries / tools | Example |
|---|---|---|
| Web development | Django, Flask, FastAPI | Instagram, codingbattle.in (built with Django!) |
| Data science and analysis | NumPy, Pandas, Matplotlib | Sales reports, dashboards |
| Machine learning and AI | scikit-learn, TensorFlow, PyTorch | Recommendation systems, chatbots |
| Automation and scripting | os, shutil, Selenium | Renaming 1000 files in seconds |
| Web scraping | BeautifulSoup, Scrapy | Collecting prices from websites |
| Game development | Pygame | 2D games |
| Desktop apps | Tkinter, PyQt | Calculators, editors |
| IoT and hardware | MicroPython, Raspberry Pi | Smart home devices |
Companies using Python include Google, YouTube, Instagram, Netflix, Spotify, Dropbox, NASA and many more.
Don't worry if you haven't installed Python yet (that is the next lesson). Just read these and guess what they do:
# This is a comment - Python ignores it
print("Welcome to Coding Battle!")
name = "Riya" # a variable (no type declaration needed)
age = 17
print(name, "is", age, "years old")
print(10 + 5) # 15
print(10 / 3) # 3.3333333333333335
print(2 ** 10) # 1024 (2 to the power 10)
print("Python " * 3) # Python Python PythonOther languages use curly braces { } to group code. Python uses indentation (4 spaces). Wrong indentation is an error, not just bad style.
age = 20
if age >= 18:
print("You can vote") # indented -> belongs to the if block
print("This always runs") # not indented -> outside the if block| Interactive mode (REPL) | Script mode |
|---|---|
| Type python in the terminal and get a >>> prompt | Write code in a .py file and run python file.py |
| Each line runs immediately | The whole file runs from top to bottom |
| Best for quick experiments and testing | Best for real programs you want to save |
| Code is lost when you close it | Code is saved and reusable |
>>> 5 + 3
8
>>> "hello".upper()
'HELLO'Type import this in the Python shell and you will see 19 guiding principles written by Tim Peters. A few favourites:
Keep these in mind — they will make you a better programmer in any language.
| # | Lesson | What you will learn |
|---|---|---|
| 1 | Introduction | What Python is and why to learn it (this blog) |
| 2 | Installation | Installing Python on Windows, Ubuntu and macOS |
| 3 | print() function | Displaying output, sep, end, f-strings |
| 4 | input() function | Taking input from the user |
| 5 | Data types | int, float, str, bool, list, tuple, set, dict |
| 6 | Lists | Storing and manipulating collections |
| 7 | if / elif / else | Making decisions |
| 8 | Loops | for and while loops |
| 9 | Functions | Reusable blocks of code |
| 10 | Programming paradigms | Procedural, OOP and functional styles |
| 11 | Classes and objects | Basics of OOP |
| 12 | random.seed() | Reproducible random numbers |
| 13 | Encapsulation and polymorphism | Protecting data and many forms |
| 14 | Inheritance | Reusing code between classes |
Don't run the code yet! Write your answers in a notebook, then check the Answers section at the end of this blog.
Q1. What is the output?
print(type(10))Q2. What is the output?
print("Py" * 3)Q3. What is the output?
print(10 / 2)Q4. What is the output?
print(2 ** 3 + 1)Q5. What happens when you run this?
if True:
print("Hello")Q6. Who created Python and in which year was it first released?
Q7. True or False: Python code is first converted into bytecode before it is executed.
Solve these from easy to tricky:
Solutions for challenges 1, 2 and 4 are in the Answers section.
Tick off each skill once you are confident:
Q: Is Python compiled or interpreted?
Both, technically. CPython compiles source code into bytecode, which is then interpreted by the Python Virtual Machine. In general conversation Python is called an interpreted language.
Q: What does "dynamically typed" mean?
The type of a variable is decided at runtime from its value. x = 5 makes x an int; later x = "hi" makes it a str.
Q: What is PEP 8?
The official style guide for Python code — naming, indentation (4 spaces), line length and more.
Q: Why is Python slower than C?
Because it is interpreted and dynamically typed — extra work happens at runtime. Libraries like NumPy solve this by running heavy work in optimised C code.
Q: What is the difference between Python 2 and Python 3?
Python 3 is the modern version. print became a function, strings are Unicode by default, and / does true division. Python 2 is no longer supported.
| Concept | Syntax / Key point |
|---|---|
| Creator | Guido van Rossum, 1991 |
| Run a file | python file.py |
| Start the shell | python |
| Comment | # this is a comment |
| Zen of Python | import this |
| Check version | python --version |
# Challenge 1
print("Riya")
print("Lucknow")
print("Mathematics")
# Challenge 2
print(25 * 4) # 100
print(100 / 8) # 12.5
print(3 ** 5) # 243
# Challenge 4
print("=" * 30) # ==============================You now know what Python is, why it is one of the most loved languages in the world, and how it runs your code. Next step: install Python on your computer in the next lesson and run your very first program!
If this blog helped you, watch the full video above, subscribe to the channel and share it with a friend who is learning Python. Happy coding!