What is Python?#
Python is a popular, general-purpose programming language. A programming language is a way to give instructions to a computer. Python is famous because its code looks almost like plain English, so it is one of the easiest languages to learn - and also one of the most powerful.
Python was created by Guido van Rossum and first released in 1991. The name comes from the British comedy show Monty Python's Flying Circus, not from the snake.
Here is a complete Python program:
print("Hello, World!")
Hello, World!
That's it - one line. In languages like C or Java, the same program needs 5-7 lines.
Why learn Python?#
| Reason | What it means for you |
|---|---|
| Easy to read and write | Fewer lines, simple syntax, less confusion for beginners |
| Huge demand in jobs | Used in AI, data science, web, automation, testing, cloud |
| Free and open source | Download and use it anywhere at no cost |
| Large library ecosystem | Ready-made packages for almost everything (pandas, django, numpy...) |
| Cross-platform | The same code runs on Windows, macOS and Linux |
| Big community | Millions of developers, tutorials and answers online |
Where is Python used?#
- Artificial Intelligence & Machine Learning - ChatGPT-style tools, image recognition (libraries: TensorFlow, PyTorch, scikit-learn)
- Data Science & Analytics - analysing sales, Excel automation, charts (pandas, matplotlib)
- Web Development - backend of websites and apps (Django, Flask, FastAPI)
- Automation & Scripting - renaming 1,000 files, sending reports, filling forms
- Software Testing - automated testing tools (Selenium, pytest)
- Desktop apps, games, IoT - Tkinter, Pygame, Raspberry Pi
Companies like Google, Netflix, Instagram, Spotify and NASA use Python in their products.
Key features of Python#
1. High-level language#
You don't manage memory or hardware details. You focus on what to do, not how the computer does it.
2. Interpreted#
Python code is run line by line by a program called the Python interpreter. You don't need a separate "compile" step. If there is an error on line 5, lines 1-4 still run first.
3. Dynamically typed#
You don't declare the type of a variable. Python figures it out:
age = 21 # Python knows this is a whole number (int)
name = "Riya" # Python knows this is text (str)
4. Indentation-based#
Python uses spaces at the start of a line (indentation) to group code, instead of { } braces. You will learn this in the next lessons.
Interpreted का मतलब है कि Python आपका कोड एक-एक लाइन करके पढ़ता है और तुरंत चलाता है - जैसे कोई अनुवादक (translator) एक-एक वाक्य का अनुवाद साथ-साथ करता है।
Dynamically typed का मतलब है कि आपको पहले से बताना नहीं पड़ता कि variable में नंबर रखेंगे या टेक्स्ट। आप सिर्फ age = 21 लिखते हैं, और Python खुद समझ जाता है कि यह नंबर है।
How a Python program runs#
- You write code in a file ending with
.py, for examplehello.py. - You run it with the command
python hello.py. - The interpreter reads the code, converts it to bytecode, and executes it.
- You see the output (or an error message that tells you what went wrong).
Your first program - try it!#
Every lesson on Vindhyaedu has a Try it Yourself editor. Change the code and press Run. Python runs right inside your browser - nothing to install.
print() is a built-in function - it displays whatever you put inside the brackets. Text must be inside quotes ("..." or '...'). Numbers don't need quotes:
Notice that print(10 + 5) prints 15 - Python calculates the answer first, then prints it.
Python is case-sensitive. print works, but Print or PRINT gives an error: NameError: name 'Print' is not defined. Also, quotes must match: "Hello' is an error.
Summary#
- Python is a high-level, interpreted, dynamically typed, general-purpose language.
- It was created by Guido van Rossum (1991) and is used in AI, data, web, automation and more.
print()shows output. Text goes inside quotes; numbers and calculations don't need quotes.- Python is case-sensitive and uses indentation to structure code.
In the next lesson you will install Python on your own computer and run your first .py file.