Python

P
PythonHub
Progress 0%

Python

  • Home
  • History of Python
  • Applications of Python
  • Introduction To Python
    • What is Python
    • Character Set
    • Tokens in Python
    • Python Execution Mode
    • Variable And Identifiers
    • Data Types in Python
    • Operators And Expressions
    • Constants in Python
    • Assignment Statement
    • Input / Output in Python
    • Simple Python Scripts
    • Namespace in Python
    • 📝 Assignments
  • Operators in Python
    • Arithmetic Operators
    • Assignment Operators
    • Shorthand Assignment Operators
    • Relational Operators
    • Logical Operators
    • Bitwise Operators
    • Special Operators
    • 📝 Assignments
  • Input Output in Python
    • Accept Input
    • Output Formatting
    • 📝 Assignments
  • Conditional Statement
    • Decision Making
    • if Statement
    • IF-ELSE STATEMENT
    • IF-ELSE LADDER
    • NESTED IF-ELSE
    • Short Hand IF-ELSE
    • 📝 Assignments
  • Loops
    • Introduction to Loops
    • While Loop
    • Nested While Loop
    • 📝 While Loop Assignments
    • For Loop
    • For Loop Examples
    • Nested For Loop
    • Nested For Loop Examples
    • Infinite While Loops
    • Infinite For Loops
    • Break, Continue and Else in Loops
    • Difference Between For and While Loop
    • For Each Loop
    • 📝 For Each Assignments
    • 📝 All Loops Assignments
  • List
    • List in Python
    • Access List Elements
    • List Functions
    • Iterate (Loop) List
    • List Comprehension
    • 📝 Assignments
  • Tuple
    • Tuple in Python
    • Access Tuple Elements
    • Tuple Functions
    • Iterate (Loop) Tuple
    • Unpack Tuple
    • Tuple Comprehension
    • 📝 Assignments
  • Set
    • Set in Python
    • Access Set Elements
    • Set Methods
    • Iterate (Loop) Set
    • Pack/Unpack Set
    • Set Comprehension
    • 📝 Assignments
  • Dictionary
    • Dictionary
    • Access Dictionary Items
    • Dictionary Methods
    • Iterate (Loop) Dictionary
    • Formatting Dictionaries
    • Nested Dictionaries
    • Dictionary Comprehension
    • 📝 Assignments
  • Diff List Tuple Set Dictionary
    • List vs Tuple
    • List vs Set
    • List vs Dictionary
    • Tuple vs Set
    • Tuple vs Dictionary
    • Dictionary vs Set
    • 📝 Assignments
  • Exception
    • Error vs Exception
    • Exception Handling
    • Types of Exception
    • User Defined Exception
    • Logging Exception
    • 📝 Assignments
  • Functions
    • Introduction to Functions
    • Modular Programming
    • Types of Functions
    • Inbuilt Functions
    • Need For User-Defined Function
    • Elements of User Defined Function
    • Function Arguments
    • Nesting of Functions
    • Recursion
    • Global Local and Non Local
    • Python Lambda Functions
    • 📝 Assignments
  • Python Module
    • Introduction to Module
    • Inbuilt Modules in Python
    • User Defined Module
    • 📝 Assignments
  • File Handling
    • Introduction to Files
    • Create File
    • Read Files
    • Write to File
    • Rename File
    • Copy File
    • Move File
    • List Files in Directory
    • Binary Files
    • Zipping and Unzipping Files
    • 📝 Assignments
  • Strings
    • Basics of Strings
    • String Special Operators
    • String Formatting Operators
    • String Methods
    • 📝 Assignments
  • Regular Expressions
  • Python OOPS
    • Basics of Object Oriented
    • What are Classes and Objects?
    • Creating Class and Object
    • OOP vs Procedural Programming
    • Difference Between Classes and Objects
    • Constructors
    • Destructor
    • Built Class Methods and Attributes
    • Class and Instance Variables
    • Inheritance in Python
    • Single Inheritance
    • Multiple Inheritance
    • Multilevel Inheritance
    • Hierarchical Inheritance
    • Hybrid Inheritance
    • Abstraction
    • Method Overriding
    • Abstract Method
    • Interfaces in Python
    • Abstract Class vs Interface
    • Public, Private and Protected
    • Overloading vs Overriding
    • Inheritance vs Composition
    • Encapsulation
    • Polymorphism
    • Inner Classes
    • 📝 Assignments
  • Advanced Python
    • Iterator in Python
    • Generator in Python
    • Decorator in Python
    • Type Hints in Python
    • Async/Await Programming
    • Dataclasses in Python
    • Context Managers in Python
    • Property Decorator in Python
    • __slots__ in Python
    • Enums in Python
    • Walrus Operator in Python
    • Match-Case in Python
    • 📝 Assignments
  • Python Standard Library
    • Collections Module
    • Itertools Module
    • Functools Module
    • Datetime Module
    • JSON Module
    • OS Module
    • Sys Module
    • Random Module
    • Math Module
    • 📝 Assignments
  • Python Testing
    • Unit Testing in Python
    • Pytest Framework
    • Mocking in Python
    • 📝 Assignments
  • Python Best Practices
    • PEP 8 Style Guide
    • Docstrings in Python
    • Logging in Python
    • Code Optimization Tips
    • Debugging Techniques
    • 📝 Assignments
  • MySQL Database in Python
    • Introduction to MySQL with Python
    • DBMS vs File System
    • Connecting to MySQL Database
    • Create Database in MySQL
    • Create Table in MySQL
    • Insert Data in MySQL
    • Insert Multiple Rows
    • Select Data from MySQL
    • WHERE Clause in MySQL
    • Update Data in MySQL
    • Delete Data from MySQL
    • Parameterized Queries
    • Transaction Management
    • Error Handling
    • Connection Pooling
    • MySQL Drivers Guide
    • Joins in MySQL
    • Aggregation Functions
    • Backup MySQL Database
    • Best Practices
    • 📝 Assignments
  • MySQL Database Operations
    • SELECT Statement
    • MySQL Operators
    • DDL Statements
    • DML Statements
    • Subqueries
    • JOIN Operations
    • Aggregation
    • Case Study
    • 📝 Assignments
  • Graphics in Python
  • Threads in Python
    • Introduction to Threads
    • Process vs Threads
    • Concurrent Programming & GIL
    • Uses of Threads
    • Creating Threads
    • Single Tasking
    • Multi Tasking
    • Thread Synchronization
    • 📝 Assignments
  • Interview Questions & Answers
  • Python Case Studies
  • Multiple Choice Questions
  • 📝 Practice Problems
Get in Touch
  • tech2dsm@gmail.com

© Sankalan Data Tech

Python Language Interactive Tutorial

🐍 What is Python?

What is Python - Programming Language Overview

Python: The language that's taking over the world of programming

Created by Sankalan Data Tech Team Verified
Data Engineers, Analysts, Scientists & Trainers
We are a team of Python developers, data engineers and data scientists with years of real-world experience. We have built production applications. We have tackled complex problems. We have helped teams ship better code. What drives us? Teaching — especially that moment when things finally click. Our tutorials focus on practical examples and honest guidance. Whether you are just starting out or leveling up we are here to make Python genuinely useful.
📑 On this page:
  • What is Python?
  • What is a Scripting Language?
  • Interpreter vs Compiler
  • Why is Python So Popular?
  • Key Features of Python
  • History of Python
  • Getting Started with Python
  • Your First Python Program
  • Try It Yourself
  • Test Your Knowledge
  • FAQ
  • Learning Resources
Share this tutorial:
Twitter LinkedIn Facebook WhatsApp Reddit Telegram Email Copy Link
📚 What You'll Learn Here
  • What is Python - Understanding Python as a programming language
  • Scripting Languages - What makes Python a scripting language
  • Interpreter vs Compiler - How Python runs your code
  • Why Python is Popular - The secret behind Python's success
  • Key Features - What makes Python special
  • History - How Python came to be
  • First Program - Your first Python code step by step

So, What Exactly is Python?

Python is a widely-used, high-level programming language that's known for being easy to read and write. It was created by Guido van Rossum back in 1991 and has been developed further by the Python Software Foundation.

Here's something I love about Python: you can express complex ideas in very few lines of code. For example, in Java, you might write 10 lines to do something that Python can do in just 1 line. That's why it's so popular with beginners and experts alike.

Python is also known as a scripting language. But what does that actually mean? Let me explain in simple terms...

💡 Did you know? Python was named after the British comedy group "Monty Python" — not the snake! Guido van Rossum was a fan of their show.

What is a Scripting Language?

A scripting language is a programming language that doesn't need to be compiled before running. Instead, it's interpreted line by line at runtime.

Here's the difference in simple terms:

  • Compiled languages (like C or Java) need to be translated into machine code first. You compile the whole program, and then you run it.
  • Scripting languages (like Python, PHP, or JavaScript) are run directly — the interpreter reads your code and executes it step by step.

I remember when I first learned this concept — it felt like magic! You just write your code and run it. No compilation step in between. That's one reason why Python is so great for beginners.

🚀 No Compilation

Write your code and run it immediately. No waiting for compilation!

🌍 Cross-Platform

Scripting languages work on any platform that has the interpreter.

⚡ Quick Development

You can test and iterate much faster than compiled languages.

Interpreter vs Compiler: What's the Difference?

Since we're talking about scripting languages, let's clear up the difference between an interpreter and a compiler.

Feature 🔄 Interpreter 📦 Compiler
What it does Executes code line by line Translates entire code to machine code
Speed Slower execution (runs on the fly) Faster execution (pre-compiled)
Errors Stops at the first error Shows all errors at once
Example Python, JavaScript, PHP C, C++, Java

Interpreter: A program that reads your code line by line and executes it directly. It's like a translator who speaks your language and the computer's language simultaneously.

Compiler: A special program that converts your entire code into machine code before execution. It's like a translator who translates the whole book first, then you read it.

Why is Python So Popular?

I get asked this question a lot. Here's the truth — Python isn't just popular; it's everywhere. Here's why:

👶 Easy to Learn

Python's syntax is clean and readable. It looks a lot like plain English, so beginners can pick it up quickly.

📚 Huge Community

Millions of Python developers worldwide mean tons of tutorials, libraries, and help when you get stuck.

🔧 Versatile

Web development, data science, AI, automation — Python does it all. You're not limited to one type of project.

📦 Rich Libraries

Python has a library for everything. Need to analyze data? Pandas. Build a website? Django. Machine learning? TensorFlow.

💼 Great Career

Python developers are in high demand. The salaries are excellent, and the opportunities keep growing.

🌍 Global Support

Python's community is active in every country. Whatever you're trying to do, someone has probably done it before.

Key Features of Python

Here are some features that make Python stand out from other languages:

  • Simple and Readable: Python was designed with readability in mind. The code looks clean and organized.
  • Interpreted: No compilation needed — just write and run.
  • Dynamically Typed: You don't need to declare variable types. Python figures it out for you.
  • Object-Oriented: Python supports OOP, which helps organize complex programs.
  • Cross-Platform: Python works on Windows, macOS, Linux, and more.
  • Open Source: Python is free to use and distribute. Anyone can contribute to its development.

A Brief History of Python

Python's story is pretty cool. Here's how it all started:

  • 1989: Guido van Rossum started working on Python during his Christmas vacation. He wanted to create a language that was easy to read and fun to use.
  • 1991: Python 0.9.0 was released. It already had classes, functions, and error handling.
  • 2000: Python 2.0 was released with new features like garbage collection and list comprehensions.
  • 2008: Python 3.0 was released — a major update that wasn't backward compatible with Python 2.
  • 2024: Python is one of the most popular programming languages in the world!

Getting Started with Python

Before you can run Python, you need an interpreter. Here's how to get started on different platforms:

🪟 Windows

  1. Download Python from python.org
  2. Run the installer (make sure to check "Add Python to PATH")
  3. Open Command Prompt and type: python --version
  4. You're ready to code!

🐧 Linux

  1. Python comes preinstalled on most Linux distros
  2. Open Terminal and type: python3 --version
  3. If not installed: sudo apt-get install python3
  4. Ready to go!

🍎 macOS

  1. Python 2.7 comes preinstalled on older macOS
  2. For Python 3, download from python.org
  3. Or use Homebrew: brew install python
  4. Check with: python3 --version

Your First Python Program

Let's write your first Python program! Open your interpreter and type this:

# Beginning of Script

print("Welcome To Python")

# End of Script

Output:
Welcome To Python

Let's break this down line by line:

  • Line 1: # Beginning of Script — This is a comment. Comments are used to explain what your code does. They're ignored by the interpreter.
  • Line 2: print("Welcome To Python") — The print() function displays text on the screen. It automatically adds a newline after printing.
  • Line 3: # End of Script — Another comment. Good practice for documenting your code.

📝 Note: In Python 2, print was a keyword (no parentheses). In Python 3, it's a function (needs parentheses). We're using Python 3 here.

Try It Yourself!

Now it's your turn! Write and run Python code directly in your browser using the editor below:

Loading Pyodide... 0%
Python Code Editor
Welcome To Python
I'm learning Python!
It's so easy to use!
42
3.14

🎯 Challenge Yourself!
• Change the text inside the print() function to your name
• Add a new line that prints your favorite number
• Try printing multiple lines with separate print() statements

🏆

🎉 You've Written Your First Python Program!

You now know what Python is, how it works, and you've even written your first program. That's a huge first step! From here, you'll learn about variables, data types, and building real applications.

Quick Quiz - Test Your Knowledge

Let's see how much you've learned about Python:

1. Who created Python?
2. Which function is used to display output in Python?
3. What symbol is used for comments in Python?

Frequently Asked Questions

🤔 Is Python free to use? ▼

Yes! Python is completely free and open source. You can download it, use it, and even modify it without paying anything. That's one of the reasons it's so popular.

💻 What do I need to start coding in Python? ▼

Just two things: the Python interpreter (download from python.org) and a code editor (like VS Code, PyCharm, or even Notepad). That's it! You can also use online platforms like Replit or Google Colab without installing anything.

🎯 What can I build with Python? ▼

Almost anything! Python is used for web development (Django, Flask), data science (Pandas, NumPy), machine learning (TensorFlow, PyTorch), automation (scripts, bots), game development (Pygame), desktop applications (Tkinter, PyQt), and much more. It's one of the most versatile languages out there.

📚 How long does it take to learn Python? ▼

You can learn the basics in just a few weeks of consistent practice. Many people write their first simple programs within days. To become proficient and build real-world applications, it usually takes 3-6 months of regular practice. The good news is that Python is much easier to learn than most other programming languages!

📚 Where to Go From Here

You've taken your first step into Python! Here's what to learn next:

🔤 Character Set

Learn about the building blocks of Python

🔣 Python Tokens

Explore keywords, identifiers, and literals

📝 Variables & Identifiers

Learn how to name and use variables effectively

📖 Related Tutorials
  • History of Python
  • Character Set in Python
  • Tokens in Python
  • Applications of Python

📚 Explore More Topics

🗄️ SQL Interview Questions

SELECT Restricting Subqueries DML Window Functions

🐍 Python Interview Questions

Intro Syntax Data Types If-Else Functions OOP

☕ Java Interview Questions

Intro Data Types Strings OOP Collections
Previous: Applications of Python Next: Character Set in Python →