Home Blogs All Courses
python c OA ( Online Assessment ) Amazon Web Services (AWS) leetcode dsa algorithms java Machine learning
Get Referral
Login Sign Up

python › Introduction

Introduction to Python: What It Is, Why Learn It, Features & Uses

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.

1. What is Python?

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.

FactDetail
Created byGuido van Rossum (Netherlands)
First released1991
Name inspired byThe British comedy show Monty Python's Flying Circus — not the snake!
Managed byPython Software Foundation (PSF)
LicenseFree and open source
Current major versionPython 3 (Python 2 reached end-of-life on 1 January 2020)
File extension.py

2. Why Learn Python? — Key Features

  • Simple and readable – code looks almost like plain English.
  • Interpreted – runs line by line, so errors are easy to find.
  • Dynamically typed – no need to declare variable types: x = 10 just works.
  • High-level – no manual memory management; Python handles it for you.
  • Cross-platform – the same code runs on Windows, macOS and Linux.
  • Huge standard library – "batteries included": files, maths, dates, web, JSON and much more.
  • Massive ecosystem – over 500,000 third-party packages on PyPI (NumPy, Pandas, Django, TensorFlow...).
  • Multi-paradigm – supports procedural, object-oriented and functional programming.
  • Great community and jobs – consistently ranked among the most popular languages in the world.

3. Less Code, Same Result

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.

4. How Does Python Run Your Code?

Python is usually called an interpreted language, but internally it works in two steps:

  1. Your source code (hello.py) is first compiled into bytecode (.pyc files, stored in __pycache__).
  2. The Python Virtual Machine (PVM) reads and executes the bytecode line by line.
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 runningCode is executed line by line by the interpreter
Usually faster at runtimeSlightly slower, but much faster to write and test
Errors shown after compiling the whole programProgram stops at the first line that has an error
Executable depends on the OSSame .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).

5. Where is Python Used?

FieldPopular libraries / toolsExample
Web developmentDjango, Flask, FastAPIInstagram, codingbattle.in (built with Django!)
Data science and analysisNumPy, Pandas, MatplotlibSales reports, dashboards
Machine learning and AIscikit-learn, TensorFlow, PyTorchRecommendation systems, chatbots
Automation and scriptingos, shutil, SeleniumRenaming 1000 files in seconds
Web scrapingBeautifulSoup, ScrapyCollecting prices from websites
Game developmentPygame2D games
Desktop appsTkinter, PyQtCalculators, editors
IoT and hardwareMicroPython, Raspberry PiSmart home devices

Companies using Python include Google, YouTube, Instagram, Netflix, Spotify, Dropbox, NASA and many more.

6. Your First Taste of Python

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 Python

Indentation is part of the syntax

Other 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

7. Interactive Mode vs Script Mode

Interactive mode (REPL)Script mode
Type python in the terminal and get a >>> promptWrite code in a .py file and run python file.py
Each line runs immediatelyThe whole file runs from top to bottom
Best for quick experiments and testingBest for real programs you want to save
Code is lost when you close itCode is saved and reusable
>>> 5 + 3
8
>>> "hello".upper()
'HELLO'

8. The Zen of Python

Type import this in the Python shell and you will see 19 guiding principles written by Tim Peters. A few favourites:

  • Beautiful is better than ugly.
  • Simple is better than complex.
  • Readability counts.
  • Errors should never pass silently.

Keep these in mind — they will make you a better programmer in any language.

9. Your Python Learning Roadmap (This Series)

#LessonWhat you will learn
1IntroductionWhat Python is and why to learn it (this blog)
2InstallationInstalling Python on Windows, Ubuntu and macOS
3print() functionDisplaying output, sep, end, f-strings
4input() functionTaking input from the user
5Data typesint, float, str, bool, list, tuple, set, dict
6ListsStoring and manipulating collections
7if / elif / elseMaking decisions
8Loopsfor and while loops
9FunctionsReusable blocks of code
10Programming paradigmsProcedural, OOP and functional styles
11Classes and objectsBasics of OOP
12random.seed()Reproducible random numbers
13Encapsulation and polymorphismProtecting data and many forms
14InheritanceReusing code between classes

Quiz: Predict the Output

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.

Practice Challenges

Solve these from easy to tricky:

  1. Print your name, your city and your favourite subject on three separate lines.
  2. Print the result of 25 × 4, 100 ÷ 8 and 3 to the power 5.
  3. Open the Python shell and type import this. Pick your favourite line and explain it in your own words.
  4. Write one line of Python that prints = 30 times (Hint: string multiplication).
  5. List three apps or websites you use daily and research whether they use Python.

Solutions for challenges 1, 2 and 4 are in the Answers section.

Self-Check: Can You Do This?

Tick off each skill once you are confident:

Frequently Asked Interview Questions

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.

Summary

  • Python is a high-level, interpreted, dynamically typed, general-purpose language created by Guido van Rossum in 1991.
  • It is famous for simple, readable syntax and a huge ecosystem of libraries.
  • Python code → bytecode → executed by the Python Virtual Machine.
  • Used in web development, data science, AI/ML, automation, scraping, games and IoT.
  • Indentation is part of the syntax — use 4 spaces.
  • You can run Python in interactive mode (REPL) or script mode (.py files).

Quick Revision Cheat Sheet

ConceptSyntax / Key point
CreatorGuido van Rossum, 1991
Run a filepython file.py
Start the shellpython
Comment# this is a comment
Zen of Pythonimport this
Check versionpython --version

Answers

Quiz answers

  1. <class 'int'> – 10 is an integer.
  2. PyPyPy – multiplying a string repeats it.
  3. 5.0 – the / operator always returns a float in Python 3.
  4. 9 – ** is power: 2³ = 8, plus 1.
  5. IndentationError – the body of if must be indented.
  6. Guido van Rossum, 1991.
  7. True – the PVM executes the bytecode.

Challenge solutions

# 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)   # ==============================

Conclusion

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!