BASIC Python (Beginner Level) 📂 Basic Python Programming · 1 of 15 126 min read

Python Programming — Complete Beginner's Guide

Learn Python programming from scratch. This tutorial covers what programming is, what makes Python unique, its history by Guido van Rossum, key benefits, advantages and disadvantages, why it dominates AI, data science, and web development, and real-world applications across industries. Includes a full setup guide for installing Python, choosing an IDE, creating virtual environments, and running your first script.

🌐
SectionSection第 01 节

What Is Programming? 🧑‍🍳Programming क्या है? 🧑‍🍳什么是编程?🧑‍🍳

The Chef and the RecipeChef और Recipe厨师与菜谱
Tell a chef "make me something tasty" and you could get pasta, sushi or salad. Hand them a recipe — exact steps in an exact order — and you get the same dish every time.

A computer is a chef that is incredibly fast and never tired, but has no common sense at all. It does exactly what you write — nothing more, nothing less. Programming is writing that recipe, called a program, in a language the computer understands.
Chef से कहें "कुछ स्वादिष्ट बना दो" तो pasta, sushi या salad कुछ भी आ सकता है। उसे recipe दें — तय क्रम में तय क़दम — तो हर बार वही डिश मिलेगी।

Computer एक ऐसा chef है जो बहुत तेज़ है और कभी थकता नहीं, पर उसमें बिल्कुल भी common sense नहीं। वह ठीक वही करता है जो आप लिखते हैं — न ज़्यादा, न कम। Programming वह recipe लिखना है, जिसे program कहते हैं, ऐसी भाषा में जिसे computer समझे।
对厨师说“给我做点好吃的”,你可能得到意面、寿司或沙拉。给他一份菜谱 —— 按固定顺序的固定步骤 —— 每次都能得到同一道菜。

计算机就是这样一位厨师:极快、永不疲倦,却完全没有常识。它严格按你写的做 —— 不多也不少。编程就是用计算机能理解的语言写下这份菜谱,也就是程序。

Programming (or coding) means designing, writing, testing and maintaining instructions that a computer follows to do a task. The instructions are written in a programming language — a language with strict rules (its syntax) that sits between human ideas and what the machine can execute.

Programming (या coding) का मतलब है ऐसे निर्देश design करना, लिखना, test करना और संभालना जिन्हें computer किसी काम के लिए follow करे। ये निर्देश programming language में लिखे जाते हैं — सख़्त नियमों (उसका syntax) वाली भाषा जो इंसानी विचार और machine के बीच पुल है।

编程(也叫写代码)就是设计、编写、测试和维护让计算机完成任务的指令。这些指令用编程语言写成 —— 一种规则严格(即语法)的语言,连接人的想法与机器能执行的操作。

LIVELIVE互动Be the Computer: Run a Program Line by LineComputer बनें: Program को Line-दर-Line चलाएँ当一回计算机:逐行运行程序

Press Step to run one line at a time. Watch the variables (the computer's memory) and the output. Change qty and run again.

एक बार में एक line चलाने के लिए Step दबाएँ। Variables (computer की memory) और output देखें। qty बदलें और फिर चलाएँ।

点击“单步”一次运行一行。观察变量(计算机的内存)和输出。改变 qty 再运行一次。

💡
The Core Ideaमूल विचार核心思想

Every app on your phone, every website, every game and every recommendation you see exists because someone wrote a program. Programming is how ideas become working software.

आपके phone का हर app, हर website, हर game और हर recommendation इसलिए है क्योंकि किसी ने program लिखा। Programming वह तरीका है जिससे विचार चलता हुआ software बनते हैं।

你手机上的每个应用、每个网站、每款游戏、看到的每条推荐,都是因为有人写了程序。编程就是把想法变成可用软件的方式。

How Programming Works — The Big PictureProgramming कैसे काम करती है — बड़ी तस्वीर编程如何进行 —— 全局视图

🔄 PICTURE 1 — THE PROGRAMMING CYCLEतस्वीर 1 — PROGRAMMING CYCLE图 1 — 编程循环
How programming works 01Defineपरिभाषित定义the problemसमस्या问题 02DesignDesign设计the stepsक़दम步骤 03Writeलिखें编写the codecode代码 04TestTest测试and debugऔर debug与调试 05DeployDeploy发布and maintainऔर maintain与维护 repeatदोहराएँ循环往复software is never "done"software कभी "पूरा" नहीं होता软件永远没有“完工”
01
Define the problem
Write it in one sentence: "Sort a list of names", "Track monthly expenses". A clear problem makes clear code.
इसे एक वाक्य में लिखें: "नामों की list sort करें", "महीने का ख़र्च track करें"। साफ़ समस्या से साफ़ code बनता है।
用一句话写下来:“给名字列表排序”“记录每月开支”。问题清楚,代码才清楚。
02
Design the algorithm
Plan the steps in plain words or a flowchart, before any code. An algorithm does not depend on the language.
Code से पहले क़दम सादे शब्दों या flowchart में सोचें। Algorithm भाषा पर निर्भर नहीं होता।
在写代码前,用简单的话或流程图规划步骤。算法与具体语言无关。
03
Write the code
Turn the steps into a programming language such as Python, using its syntax, data types and functions.
क़दमों को Python जैसी programming language में बदलें, उसके syntax, data types और functions से।
用 Python 等编程语言,借助其语法、数据类型和函数把步骤写成代码。
04
Test and debug
Run it, find the bugs (mistakes), fix them, and check the output. Expect to repeat this many times.
चलाएँ, bugs (ग़लतियाँ) ढूँढें, ठीक करें, और output जाँचें। इसे कई बार दोहराना सामान्य है।
运行,找出 bug(错误),修复,检查输出。这一步通常要反复很多次。
05
Deploy and maintain
Give it to users, watch for problems, add features and update it. Software is never really "finished".
Users को दें, समस्याओं पर नज़र रखें, features जोड़ें और update करें। Software कभी सच में "पूरा" नहीं होता।
交给用户使用,留意问题,增加功能、持续更新。软件从来没有真正“完成”。

SectionSection第 02 节

What Is Python? 🐍Python क्या है? 🐍什么是 Python?🐍

Python is a high-level, general-purpose programming language designed to be easy to read. Where many languages use curly braces and semicolons, Python uses indentation (spaces at the start of a line) to group code, so programs look close to plain English.

Python एक high-level, general-purpose programming language है जो पढ़ने में आसान होने के लिए बनी है। जहाँ कई भाषाएँ curly braces और semicolons इस्तेमाल करती हैं, Python code को group करने के लिए indentation (line की शुरुआत में spaces) इस्तेमाल करता है, इसलिए programs लगभग सादी अंग्रेज़ी जैसे दिखते हैं।

Python 是一种高级、通用的编程语言,设计目标是易读。许多语言用花括号和分号,而 Python 用缩进(行首的空格)来组织代码,所以程序读起来接近普通英语。

🧠
High-levelHigh-level高级语言
Hides the hardwareHardware छिपाता है屏蔽硬件细节
You say what to do; Python handles memory for you. No pointers, no manual memory management.
आप बताते हैं क्या करना है; memory Python संभालता है। कोई pointers नहीं, कोई manual memory management नहीं।
你只说做什么,内存由 Python 管理。没有指针,也不用手动管理内存。
⚙️
Compiled to bytecode, then interpretedपहले bytecode, फिर interpret先编译成字节码,再解释执行
No separate build stepअलग build step नहीं无需单独构建
You run the file directly. Behind the scenes, CPython first compiles the whole file to bytecode, then its virtual machine runs that bytecode. (See the animation below.)
आप file सीधे चलाते हैं। पर्दे के पीछे CPython पहले पूरी file को bytecode में compile करता है, फिर उसकी virtual machine उस bytecode को चलाती है। (नीचे animation देखें।)
你直接运行文件。幕后,CPython 先把整个文件编译成字节码,再由虚拟机执行字节码。(见下方动画。)
🏷️
Dynamically typedDynamically typed动态类型
Types are checked while runningTypes चलते समय जाँचे जाते हैं运行时检查类型
You don't declare types: after x = 10, x holds an int; after x = "hello" it holds a str. A type mistake shows up only when that line runs.
आप types घोषित नहीं करते: x = 10 के बाद x में int है; x = "hello" के बाद str। Type की ग़लती तभी दिखती है जब वह line चलती है।
不用声明类型:x = 10 后 x 是 int;x = "hello" 后是 str。类型错误只有在那一行运行时才会暴露。
LIVELIVE互动How Python Really Runs Your FilePython आपकी File असल में कैसे चलाता हैPython 实际上如何运行你的文件

Two tiny files with a mistake on line 3. Pick one and press python3. The output is real.

दो छोटी files, दोनों की line 3 में ग़लती। एक चुनें और python3 दबाएँ। Output असली है।

两个小文件,第 3 行都有错误。选一个,点击 python3。输出是真实的。

Program

Want to see the bytecode? The dis module shows the simple instructions Python's virtual machine runs for one line of code:

Bytecode देखना है? dis module दिखाता है कि code की एक line के लिए Python की virtual machine कौन से सरल निर्देश चलाती है:

想看看字节码吗?dis 模块会显示 Python 虚拟机为一行代码执行的简单指令:

import dis
dis.dis(compile('total = price * qty', '<demo>', 'exec'))
OUTPUT
0 RESUME 0 1 LOAD_NAME 0 (price) LOAD_NAME 1 (qty) BINARY_OP 5 (*) STORE_NAME 2 (total) RETURN_CONST 0 (None)
🔑
Python's PhilosophyPython का दर्शनPython 的理念

Type import this in Python to read the Zen of Python, 19 short lines by Tim Peters. It starts "Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex." and includes "There should be one — and preferably only one — obvious way to do it."

Python में import this लिखें और Tim Peters की 19 छोटी lines, Zen of Python, पढ़ें। यह शुरू होता है "Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex." से और इसमें "There should be one — and preferably only one — obvious way to do it." भी है।

在 Python 中输入 import this,就能读到 Tim Peters 写的 19 句《Python 之禅》。开头是 “Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex.”,其中还有 “There should be one — and preferably only one — obvious way to do it.”

Python vs Other Languages — Hello, World!Python बनाम दूसरी भाषाएँ — Hello, World!Python 与其他语言 —— Hello, World!

LIVELIVE互动Hello, World! in Six Languagesछह भाषाओं में Hello, World!六种语言的 Hello, World!

Every program below was compiled or run and printed Hello, World! (Java 25 needs a newer JDK than our test machine had.)

नीचे का हर program compile या run हुआ और Hello, World! छपा। (Java 25 को हमारी test machine से नया JDK चाहिए।)

下面每个程序都编译或运行过,并打印出 Hello, World!(Java 25 需要比我们测试机更新的 JDK。)

Language


SectionSection第 03 节

Who Created Python? 👨‍💻Python किसने बनाया? 👨‍💻Python 是谁创造的?👨‍💻

A Christmas Hobby ProjectChristmas का एक Hobby Project一个圣诞节业余项目
In December 1989, Dutch programmer Guido van Rossum, working at CWI in Amsterdam, wanted a hobby project for the Christmas week. He liked the teaching language ABC but found it too rigid, and wanted something easy to read yet powerful enough for real work.

He named it after the British comedy show Monty Python's Flying Circus — not the snake. Version 0.9.0 was posted publicly in February 1991, already with classes, functions, exceptions, lists and dictionaries.

Guido led the language as its "Benevolent Dictator For Life" until he stepped down in July 2018. Since 2019 Python has been guided by a five-person Steering Council elected by the core developers.
December 1989 में Amsterdam के CWI में काम करने वाले Dutch programmer Guido van Rossum Christmas वाले हफ़्ते के लिए एक hobby project चाहते थे। उन्हें सिखाने वाली भाषा ABC पसंद थी पर वह बहुत सख़्त लगती थी, और वे कुछ ऐसा चाहते थे जो पढ़ने में आसान हो फिर भी असली काम के लिए ताक़तवर।

उन्होंने इसका नाम British comedy show Monty Python's Flying Circus पर रखा — साँप पर नहीं। Version 0.9.0 February 1991 में सार्वजनिक हुआ, जिसमें पहले से classes, functions, exceptions, lists और dictionaries थे।

Guido ने July 2018 में हटने तक "Benevolent Dictator For Life" के रूप में भाषा का नेतृत्व किया। 2019 से Python को core developers द्वारा चुनी गई पाँच लोगों की Steering Council चलाती है।
1989 年 12 月,在阿姆斯特丹 CWI 工作的荷兰程序员 Guido van Rossum 想找个圣诞周的业余项目。他喜欢教学语言 ABC,但觉得它太死板,想要一种易读又足够胜任实际工作的语言。

他用英国喜剧节目 Monty Python's Flying Circus 命名 —— 而不是蟒蛇。0.9.0 版于 1991 年 2 月公开发布,已经具备类、函数、异常、列表和字典。

Guido 以“终身仁慈独裁者”身份领导这门语言,直到 2018 年 7 月卸任。自 2019 年起,Python 由核心开发者选出的五人指导委员会领导。
🗓️ PICTURE 2 — PYTHON TIMELINEतस्वीर 2 — PYTHON TIMELINE图 2 — Python 时间线
Python timeline 1989Christmas: Guido van Rossum starts a hobby projectChristmas: Guido van Rossum एक hobby project शुरू करते हैं圣诞假期:Guido van Rossum 开始一个业余项目 19910.9.0 — first public release (February)0.9.0 — पहला public release (February)0.9.0 —— 首次公开发布(2 月) 19941.0 — lambda, map, filter, reduce1.0 — lambda, map, filter, reduce1.0 —— lambda、map、filter、reduce 20002.0 — list comprehensions, cycle-collecting garbage collector2.0 — list comprehensions, cycle-collecting garbage collector2.0 —— 列表推导式、可回收循环引用的垃圾回收 20083.0 — a clean-up that broke backward compatibility3.0 — एक सफ़ाई जिसने पुराना code तोड़ा3.0 —— 一次不兼容旧代码的大清理 2018Guido steps down; a Steering Council leads from 2019Guido हटे; 2019 से Steering Council नेतृत्व करती हैGuido 卸任;2019 年起由指导委员会领导 2020Python 2 reaches end of life (1 January)Python 2 का जीवन ख़त्म (1 January)Python 2 停止支持(1 月 1 日) 20253.14 — free-threaded (no-GIL) build officially supported3.14 — free-threaded (no-GIL) build को आधिकारिक support3.14 —— 自由线程(无 GIL)版本获正式支持 20263.15 (9 October) — UTF-8 by default, frozendict, faster JIT3.15 (9 October) — default UTF-8, frozendict, तेज़ JIT3.15(10 月 9 日)—— 默认 UTF-8、frozendict、更快的 JIT

A new version now comes out every October. Python 3.15.0 was released on 9 October 2026.

अब हर October नया version आता है। Python 3.15.0, 9 October 2026 को release हुआ।

现在每年 10 月发布一个新版本。Python 3.15.0 于 2026 年 10 月 9 日发布。


SectionSection第 04 节

Benefits of Python 🌟Python के फ़ायदे 🌟Python 的优点 🌟

📚
Easy to learn and readसीखने और पढ़ने में आसान易学易读
Beginner-friendlyBeginner-friendly适合初学者
Clean syntax and enforced indentation. Beginners write useful programs in their first week.
साफ़ syntax और ज़रूरी indentation। Beginners पहले हफ़्ते में काम के programs लिख लेते हैं।
语法简洁,强制缩进。初学者第一周就能写出有用的程序。
⚡
Fast to writeलिखने में तेज़开发快
Short codeछोटा code代码简短
Fewer lines and a large standard library mean you go from idea to working prototype quickly.
कम lines और बड़ी standard library से आप विचार से चलते prototype तक जल्दी पहुँचते हैं।
代码行数少、标准库丰富,从想法到可用原型很快。
📦
Huge ecosystemविशाल ecosystem庞大的生态
736,000+ packages on PyPI (Mar 2026)PyPI पर 736,000+ packages (Mar 2026)PyPI 上 73.6 万+ 个包(2026 年 3 月)
Machine learning: scikit-learn, PyTorch. Web: Django, FastAPI. Data: pandas. Someone has probably solved part of your problem.
Machine learning: scikit-learn, PyTorch। Web: Django, FastAPI। Data: pandas। आपकी समस्या का कुछ हिस्सा शायद किसी ने हल कर रखा है।
机器学习:scikit-learn、PyTorch。Web:Django、FastAPI。数据:pandas。你的问题很可能已经有人解决了一部分。
🌐
Cross-platformCross-platform跨平台
Windows, macOS, LinuxWindows, macOS, LinuxWindows、macOS、Linux
The same script usually runs on all three. Watch out for file paths and OS-specific commands.
वही script आमतौर पर तीनों पर चलती है। File paths और OS-specific commands पर ध्यान दें।
同一脚本通常能在三者上运行。注意文件路径和特定系统的命令。
🤝
Big communityबड़ी community社区庞大
Help is a search awayमदद एक search दूर一搜就有帮助
Millions of users, free tutorials, Stack Overflow answers and active forums at discuss.python.org.
लाखों users, मुफ़्त tutorials, Stack Overflow जवाब और discuss.python.org पर सक्रिय forums।
数百万用户、免费教程、Stack Overflow 答案,以及活跃的 discuss.python.org 论坛。
💼
In demandमाँग में需求旺盛
#1 on TIOBE, Oct 2026TIOBE पर #1, Oct 2026TIOBE 2026 年 10 月第 1
Data science, AI, back-end web and automation jobs all ask for Python.
Data science, AI, back-end web और automation की नौकरियाँ सब Python माँगती हैं।
数据科学、人工智能、后端开发和自动化岗位都要求 Python。

SectionSection第 05 节

Advantages and Disadvantages ⚖️फ़ायदे और नुक़सान ⚖️优点与缺点 ⚖️

❌ Disadvantagesनुक़सान缺点
#Disadvantageनुक़सान缺点
1Slower for pure loops — about 164× slower than C in our race belowसादे loops में धीमा — नीचे की दौड़ में C से लगभग 164× धीमा纯循环较慢 —— 在下方比赛中约比 C 慢 164 倍
2GIL — one thread runs Python code at a time in the standard build (a free-threaded build has been officially supported since 3.14)GIL — standard build में एक समय में एक thread Python code चलाता है (3.14 से free-threaded build को आधिकारिक support)GIL —— 标准版本中同一时刻只有一个线程执行 Python 代码(3.14 起自由线程版本获正式支持)
3More memory — every value is a full objectज़्यादा memory — हर मान पूरा object है内存占用较多 —— 每个值都是完整对象
4Weak on mobile — few native app frameworksMobile पर कमज़ोर — native app frameworks कम移动端较弱 —— 原生应用框架少
5Type mistakes appear late — at run time (type hints + a checker help)Type ग़लतियाँ देर से दिखती हैं — run time पर (type hints + checker मदद करते हैं)类型错误发现较晚 —— 运行时才出现(类型注解 + 检查工具可帮忙)
6Packaging can be confusing — many tools; use venv + pip to startPackaging उलझन भरी हो सकती है — कई tools; शुरुआत venv + pip से打包可能令人困惑 —— 工具很多;入门用 venv + pip
✅ Advantagesफ़ायदे优点
#Advantageफ़ायदा优点
1Simple syntax — reads like pseudocodeसरल syntax — pseudocode जैसा语法简单 —— 读起来像伪代码
2Huge library ecosystem — 736,000+ packagesविशाल library ecosystem — 736,000+ packages库生态庞大 —— 73.6 万+ 个包
3Versatile — web, AI, data, automationबहुमुखी — web, AI, data, automation用途广 —— Web、AI、数据、自动化
4Free and open sourceमुफ़्त और open source免费开源
5Run instantly — no separate build stepतुरंत चलाएँ — अलग build step नहीं即写即运行 —— 无需单独构建
6Glue language — calls C/C++ libraries, databases and web APIsGlue language — C/C++ libraries, databases और web APIs बुलाती है胶水语言 —— 可调用 C/C++ 库、数据库和 Web API
LIVELIVE互动The Speed RaceSpeed की दौड़速度赛跑

Four ways to add up 0 … 9,999,999. Times were measured on the machine that built this page (median of several runs); the animation replays them in real time.

0 … 9,999,999 जोड़ने के चार तरीके। समय इस page को बनाने वाली machine पर मापा गया (कई runs का median); animation उन्हें असली समय में दोहराता है।

四种方式累加 0 … 9,999,999。时间在生成本页的机器上测得(多次运行的中位数);动画按真实时间重放。

# speed.py — add up the numbers 0 … 9,999,999 three ways
import time
import numpy as np

N = 10_000_000

t = time.perf_counter()
total = 0
for i in range(N):          # Python runs this loop one step at a time
    total += i
loop = time.perf_counter() - t

t = time.perf_counter()
total2 = sum(range(N))      # the built-in sum() loops in C
builtin = time.perf_counter() - t

t = time.perf_counter()
total3 = int(np.arange(N).sum())   # NumPy: one C call on a whole array
vec = time.perf_counter() - t

print(f"answer: {total:,} (all three agree: {total == total2 == total3})")
print(f"plain for-loop : {loop:.3f} s")
print(f"built-in sum() : {builtin:.3f} s  ({loop / builtin:.0f}× faster)")
print(f"NumPy          : {vec:.3f} s  ({loop / vec:.0f}× faster)")
OUTPUT
answer: 49,999,995,000,000 (all three agree: True) plain for-loop : 0.983 s built-in sum() : 0.130 s (8× faster) NumPy : 0.024 s (41× faster)
⚠️
Speed Is Rarely the First ProblemSpeed शायद ही पहली समस्या होती है速度很少是首要问题

A pure Python loop really is much slower than C — here about 164×. But most programs spend their time waiting for files, networks or databases, and developer time usually costs more than computer time. When number-crunching matters, use built-ins and libraries such as NumPy, which run their loops in C: in the race, NumPy closed most of the gap without leaving Python.

सादा Python loop सच में C से बहुत धीमा है — यहाँ लगभग 164×। पर ज़्यादातर programs का समय files, network या databases का इंतज़ार करने में जाता है, और developer का समय आमतौर पर computer के समय से महँगा होता है। जब गणना मायने रखे, तब built-ins और NumPy जैसी libraries इस्तेमाल करें, जो अपने loops C में चलाती हैं: दौड़ में NumPy ने Python छोड़े बिना ज़्यादातर अंतर भर दिया।

纯 Python 循环确实比 C 慢很多 —— 这里约 164 倍。但大多数程序的时间花在等待文件、网络或数据库上,而开发者的时间通常比计算机的时间更贵。需要大量计算时,用内置函数和 NumPy 等库,它们在 C 中执行循环:在比赛中,NumPy 不离开 Python 就弥补了大部分差距。


SectionSection第 06 节

Why Is Python So Popular? 🚀Python इतना लोकप्रिय क्यों है? 🚀Python 为什么这么流行?🚀

Python has been #1 on the TIOBE Index since October 2021 and is still first in October 2026, though its lead has narrowed over the past year. It also tops IEEE Spectrum's ranking. Several things push it:

Python October 2021 से TIOBE Index पर #1 है और October 2026 में भी पहले स्थान पर है, हालाँकि पिछले साल इसकी बढ़त घटी है। यह IEEE Spectrum की ranking में भी सबसे ऊपर है। इसके पीछे कई कारण हैं:

Python 自 2021 年 10 月起一直位居 TIOBE 指数第 1,2026 年 10 月仍然第一,尽管过去一年领先优势有所缩小。它在 IEEE Spectrum 排行中也名列前茅。推动它的因素有:

🤖
AI and machine learningAI और machine learning人工智能与机器学习
PyTorch · TensorFlow · scikit-learn
The main deep-learning frameworks are Python-first. When AI took off, Python went with it.
मुख्य deep-learning frameworks Python-first हैं। AI बढ़ा तो Python भी साथ बढ़ा।
主流深度学习框架都以 Python 为先。AI 腾飞,Python 随之腾飞。
📊
Data scienceData science数据科学
pandas · NumPy · Matplotlib · Jupyter
Cleaning, analysing and plotting data; Jupyter notebooks made it the everyday tool of analysts and researchers.
Data साफ़ करना, analyse और plot करना; Jupyter notebooks ने इसे analysts और researchers का रोज़ का tool बना दिया।
清洗、分析、绘制数据;Jupyter 笔记本让它成为分析师和研究人员的日常工具。
🎓
Taught firstपहले सिखाई जाती है入门首选
Universities and schoolsUniversities और schools大学与中小学
Many universities use Python for first courses — MIT's 6.100L and Stanford's CS106A, for example. (Harvard's CS50 starts with C and then moves to Python.)
कई universities पहले courses में Python इस्तेमाल करती हैं — जैसे MIT का 6.100L और Stanford का CS106A। (Harvard का CS50 C से शुरू होकर फिर Python पर जाता है।)
许多大学的入门课程使用 Python,例如 MIT 的 6.100L 和斯坦福的 CS106A。(哈佛 CS50 先教 C,再转到 Python。)
🛠️
Automation and DevOpsAutomation और DevOps自动化与运维
Ansible · scripts · CI/CD
Admins automate servers, deployments and reports with short Python scripts.
Admins छोटी Python scripts से servers, deployments और reports automate करते हैं।
管理员用简短的 Python 脚本自动化服务器、部署和报表。
🌍
Web back endsWeb back endsWeb 后端
Django · Flask · FastAPI
Instagram runs on Django; FastAPI is popular for modern APIs.
Instagram, Django पर चलता है; FastAPI आधुनिक APIs के लिए लोकप्रिय है।
Instagram 基于 Django;FastAPI 在现代 API 开发中很受欢迎。
🚪
Low barrier to entryशुरुआत आसान入门门槛低
No boilerplateकोई boilerplate नहीं没有样板代码
Write print("Hello") and you have a working program.
print("Hello") लिखें और आपका program चल गया।
写下 print("Hello"),你就有了一个能运行的程序。

SectionSection第 07 节

Where Is Python Used? 🗺️Python कहाँ इस्तेमाल होता है? 🗺️Python 用在哪里?🗺️

Domainक्षेत्र领域What Python doesPython क्या करता हैPython 做什么Key librariesमुख्य libraries主要库Examplesउदाहरण例子
WebWebWebBack-end APIs and full web appsBack-end APIs और पूरे web apps后端 API 与完整 Web 应用Django, Flask, FastAPIInstagram, Pinterest, Mozilla
Data scienceData science数据科学Cleaning, analysis, charts, statisticsसफ़ाई, analysis, charts, statistics清洗、分析、图表、统计pandas, NumPy, MatplotlibNetflix, Spotify
AI / machine learningAI / machine learningAI / 机器学习Training models, NLP, computer visionModels train करना, NLP, computer vision训练模型、自然语言处理、计算机视觉PyTorch, TensorFlow, scikit-learnGoogle, Meta, OpenAI
AutomationAutomation自动化Files, web scraping, reports, testingFiles, web scraping, reports, testing文件处理、网页抓取、报表、测试Selenium, Playwright, Beautiful Soupalmost every companyलगभग हर कंपनी几乎每家公司
DevOps / cloudDevOps / cloud运维 / 云Infrastructure automation, deploymentInfrastructure automation, deployment基础设施自动化、部署Ansible, Boto3 (AWS SDK)Red Hat (Ansible), AWS
GamesGames游戏2D games, prototypes, visual novels2D games, prototypes, visual novels2D 游戏、原型、视觉小说Pygame, Panda3D, Ren'Pyindie studios, teachingindie studios, शिक्षण独立工作室、教学
FinanceFinance金融Risk analysis, pricing, fraud detectionRisk analysis, pricing, fraud detection风险分析、定价、欺诈检测pandas, QuantLib (Python bindings)banks such as JPMorganJPMorgan जैसे banks摩根大通等银行
ScienceScience科学计算Simulations, astronomy, biologySimulations, astronomy, biology模拟、天文、生物SciPy, Astropy, BiopythonNASA, CERN
Cyber securityCyber security网络安全Network tools, testing, forensicsNetwork tools, testing, forensics网络工具、测试、取证Scapy, Impacketsecurity teamssecurity teams安全团队
🎯
Python Is a "Glue Language"Python एक "Glue Language" हैPython 是一种“胶水语言”

Python is great at connecting things: it can call fast C libraries, talk to web APIs, read spreadsheets, query databases and send emails — all in one short script. That is why it shows up in every field.

Python चीज़ों को जोड़ने में बेहतरीन है: यह तेज़ C libraries बुला सकता है, web APIs से बात कर सकता है, spreadsheets पढ़ सकता है, databases से query कर सकता है और emails भेज सकता है — सब एक छोटी script में। इसीलिए यह हर क्षेत्र में दिखता है।

Python 擅长把各种东西连接起来:调用高速 C 库、访问 Web API、读取电子表格、查询数据库、发送邮件 —— 全在一个简短脚本里。这就是它出现在各个领域的原因。


SectionSection第 08 节

Installing Python 💻Python Install करना 💻安装 Python 💻

💻 Installation by operating systemOperating system के हिसाब से installation按操作系统安装
Windows
Recommended: install the Python install manager from the Microsoft Store (or python.org). It adds the py and python commands and keeps versions up to date; a first run walks you through settings. The classic installer still exists until Python 3.16 — if you use it, tick "Add python.exe to PATH". सुझाव: Microsoft Store (या python.org) से Python install manager install करें। यह py और python commands जोड़ता है और versions को up to date रखता है; पहली बार चलाने पर settings में मदद करता है। पुराना installer Python 3.16 तक मौजूद है — उसे इस्तेमाल करें तो "Add python.exe to PATH" पर tick करें। 推荐:从 Microsoft Store(或 python.org)安装 Python 安装管理器。它提供 py 和 python 命令并自动保持版本更新;首次运行会引导你完成设置。传统安装程序会保留到 Python 3.16 —— 如果使用它,请勾选 “Add python.exe to PATH”。
macOS
Download the macOS installer from python.org, or with Homebrew run brew install python. Use python3 in the terminal. python.org से macOS installer download करें, या Homebrew से brew install python चलाएँ। Terminal में python3 इस्तेमाल करें। 从 python.org 下载 macOS 安装包,或用 Homebrew 运行 brew install python。在终端中使用 python3。
Linux
Python 3 is usually already there. On Ubuntu/Debian: sudo apt install python3 python3-pip python3-venv. Newer releases block pip install into the system Python ("externally managed") — that is your cue to use a virtual environment (Section 11). Python 3 आमतौर पर पहले से होता है। Ubuntu/Debian पर: sudo apt install python3 python3-pip python3-venv। नए releases system Python में pip install रोकते हैं ("externally managed") — यही संकेत है कि virtual environment इस्तेमाल करें (Section 11)। 通常已预装 Python 3。Ubuntu/Debian 上:sudo apt install python3 python3-pip python3-venv。较新版本会阻止向系统 Python 执行 pip install(“externally managed”)—— 这正提示你该用虚拟环境(第 11 节)。
⚠️
The Most Common Windows ProblemWindows की सबसे आम समस्याWindows 上最常见的问题

"python is not recognized" or the Microsoft Store opening when you type python means Windows cannot find your Python. With the install manager, use py or rerun its configuration (py install --configure). With the classic installer, rerun it, choose "Modify", and make sure Python is added to PATH.

"python is not recognized" या python लिखने पर Microsoft Store खुलना, मतलब Windows को आपका Python नहीं मिल रहा। Install manager के साथ py इस्तेमाल करें या उसकी configuration दोबारा चलाएँ (py install --configure)। पुराने installer के साथ उसे दोबारा चलाएँ, "Modify" चुनें, और पक्का करें कि Python PATH में जुड़ा हो।

出现 “python is not recognized”,或输入 python 却打开了 Microsoft Store,说明 Windows 找不到你的 Python。使用安装管理器时,请用 py,或重新运行其配置(py install --configure)。使用传统安装程序时,重新运行它,选择 “Modify”,确保把 Python 加入 PATH。

Check your installationInstallation जाँचें检查安装

# macOS / Linux
python3 --version
python3 -m pip --version

# Windows
py --version
py -m pip --version
OUTPUT
Python 3.13.16 pip 24.0 (output on our Linux test machine)

SectionSection第 09 节

Choosing an Editor 🧰Editor चुनना 🧰选择编辑器 🧰

An IDE or code editor is where you write, run and debug code. Any of these is a good start:

IDE या code editor वह जगह है जहाँ आप code लिखते, चलाते और debug करते हैं। इनमें से कोई भी अच्छी शुरुआत है:

IDE 或代码编辑器是你编写、运行和调试代码的地方。下面任何一个都是不错的起点:

🔷
VS Code
Free — Microsoftमुफ़्त — Microsoft免费 —— 微软
Light, fast and extensible. Add the Python extension for autocompletion, debugging, linting and notebooks. Works for every language you will learn later.
हल्का, तेज़ और extensible। Autocompletion, debugging, linting और notebooks के लिए Python extension जोड़ें। बाद में सीखी हर भाषा के लिए काम आता है।
轻量、快速、可扩展。安装 Python 扩展即可获得自动补全、调试、代码检查和笔记本功能。适用于你以后学的所有语言。
💻
PyCharm
Free and paid — JetBrainsमुफ़्त और paid — JetBrains免费与付费 —— JetBrains
Built for Python: excellent debugger, refactoring and code checks out of the box. Heavier on memory than VS Code.
Python के लिए बना: शुरू से बेहतरीन debugger, refactoring और code checks। VS Code से ज़्यादा memory लेता है।
专为 Python 打造:开箱即有出色的调试、重构和代码检查。比 VS Code 更占内存。
📓
Jupyter
Free — open sourceमुफ़्त — open source免费 —— 开源
Run code in small cells and see results, tables and charts right below. The standard tool for data exploration; not meant for large applications.
Code को छोटे cells में चलाएँ और नतीजे, tables और charts ठीक नीचे देखें। Data exploration का मानक tool; बड़े applications के लिए नहीं।
在小单元格中运行代码,结果、表格和图表就显示在下方。数据探索的标准工具;不适合大型应用。
🔑
Recommendation for BeginnersBeginners के लिए सुझाव给初学者的建议

Start with VS Code + the Python extension. It is free and light, and its built-in Jupyter support gives you notebooks in the same editor when you start data work.

VS Code + Python extension से शुरू करें। यह मुफ़्त और हल्का है, और data का काम शुरू करने पर इसका built-in Jupyter support उसी editor में notebooks देता है।

从 VS Code + Python 扩展开始。它免费、轻量,开始做数据分析时,内置的 Jupyter 支持让你在同一个编辑器里使用笔记本。


SectionSection第 10 节

Running Your First Python Code ▶️अपना पहला Python Code चलाना ▶️运行你的第一段 Python 代码 ▶️

Method 1 — Interactive mode (the REPL)तरीका 1 — Interactive mode (REPL)方式 1 —— 交互模式(REPL)

The REPL (Read–Eval–Print Loop) runs each line as soon as you press Enter. Type python3 (or py on Windows) and you get the >>> prompt. When you type an expression, the REPL shows its value — strings appear with quotes, because the REPL shows how Python writes the value, not how print would.

REPL (Read–Eval–Print Loop) Enter दबाते ही हर line चलाता है। python3 (या Windows पर py) लिखें और >>> prompt मिलेगा। जब आप कोई expression लिखते हैं, REPL उसका मान दिखाता है — strings quotes के साथ दिखती हैं, क्योंकि REPL दिखाता है कि Python मान को कैसे लिखता है, न कि print कैसे छापेगा।

REPL(读取–求值–输出循环)在你按下回车后立即运行每一行。输入 python3(Windows 上输入 py),就会出现 >>> 提示符。输入表达式时,REPL 会显示它的值 —— 字符串带引号显示,因为 REPL 展示的是 Python 书写该值的方式,而不是 print 的输出。

>>> print("Hello, World!")
Hello, World!
>>> 2 + 3
5
>>> "Python" * 3
'PythonPythonPython'
>>> 10 / 4
2.5
>>> 10 // 4
2
>>> 0.1 + 0.2
0.30000000000000004
>>> name = "Asha"
>>> name.upper()
'ASHA'
🐛
Two Details Fixed From the Originalमूल से ठीक की गई दो बातें对原文的两处修正

The original showed PythonPythonPython without quotes; the real REPL prints 'PythonPythonPython'. And notice 0.1 + 0.2 gives 0.30000000000000004 — computers store decimals in binary, so tiny rounding errors are normal in every language.

मूल में PythonPythonPython बिना quotes के था; असली REPL 'PythonPythonPython' छापता है। और देखें 0.1 + 0.2 से 0.30000000000000004 आता है — computers दशमलव संख्याएँ binary में रखते हैं, इसलिए छोटी rounding ग़लतियाँ हर भाषा में सामान्य हैं।

原文显示的 PythonPythonPython 没有引号;真实的 REPL 打印的是 'PythonPythonPython'。另外注意 0.1 + 0.2 得到 0.30000000000000004 —— 计算机用二进制存储小数,所以微小的舍入误差在所有语言中都很正常。

Method 2 — Script mode (the real way)तरीका 2 — Script mode (असली तरीका)方式 2 —— 脚本模式(正式做法)

For real programs, save your code in a .py file and run the file.

असली programs के लिए code को .py file में save करें और file चलाएँ।

编写正式程序时,把代码保存在 .py 文件中,然后运行这个文件。

# hello.py
name = input("What is your name? ")
age = int(input("How old are you? "))
year = 2026 - age

print(f"Hello, {name}!")
print(f"You were born in {year} or {year - 1}.")
print(f"In 10 years, you'll be {age + 10}!")
python3 hello.py        # Windows: py hello.py
OUTPUT
What is your name? Asha How old are you? 30 Hello, Asha! You were born in 1996 or 1995. In 10 years, you'll be 40!
🧮
Why "1996 or 1995"?"1996 या 1995" क्यों?为什么是“1996 或 1995”?

Knowing only someone's age and the current year, you cannot know their birth year exactly — it depends on whether their birthday has passed. The original printed "born around 1996"; a program should say only what it can know.

सिर्फ़ उम्र और मौजूदा साल जानकर जन्म का साल ठीक-ठीक नहीं पता चलता — यह इस पर निर्भर है कि उनका जन्मदिन इस साल बीता या नहीं। मूल ने "born around 1996" छापा था; program को वही कहना चाहिए जो वह जान सकता है।

只知道年龄和今年年份,无法确定出生年份 —— 这取决于今年的生日是否已过。原文打印的是“大约生于 1996 年”;程序应该只说它能确定的事。

Method 3 — Inside VS Codeतरीका 3 — VS Code के अंदर方式 3 —— 在 VS Code 中

🛠️ Running Python in VS CodeVS Code में Python चलाना在 VS Code 中运行 Python
Step 1
Install the Python extension from the Extensions view (Ctrl+Shift+X). Extensions view (Ctrl+Shift+X) से Python extension install करें। 在扩展视图(Ctrl+Shift+X)中安装 Python 扩展。
Step 2
Create a file and save it as hello.py. एक file बनाएँ और उसे hello.py नाम से save करें। 新建文件并保存为 hello.py。
Step 3
Pick your interpreter (bottom-right, or Ctrl+Shift+P → "Python: Select Interpreter") — choose your virtual environment if you have one. अपना interpreter चुनें (नीचे-दाएँ, या Ctrl+Shift+P → "Python: Select Interpreter") — virtual environment हो तो उसे चुनें। 选择解释器(右下角,或 Ctrl+Shift+P → “Python: Select Interpreter”)—— 如有虚拟环境就选它。
Step 4
Click ▶ Run Python File (top-right). Output appears in the terminal, where you can also type answers to input(). ▶ Run Python File (ऊपर-दाएँ) पर click करें। Output terminal में आता है, जहाँ आप input() के जवाब भी लिख सकते हैं। 点击右上角的 ▶ Run Python File。输出显示在终端中,你也可以在那里输入 input() 的回答。

SectionSection第 11 节

Virtual Environments 📦Virtual Environments 📦虚拟环境 📦

A virtual environment is a private folder of packages for one project. Project A can use one version of a library while project B uses another, and neither touches the system Python. This avoids the classic "it works on my machine" problem.

Virtual environment एक project के लिए packages का निजी folder है। Project A किसी library का एक version इस्तेमाल कर सकता है और project B दूसरा, और कोई भी system Python को नहीं छूता। इससे "मेरी machine पर तो चलता है" वाली क्लासिक समस्या से बचते हैं।

虚拟环境是某个项目专用的包文件夹。项目 A 可以用某个库的一个版本,项目 B 用另一个版本,两者都不影响系统 Python。这避免了经典的“在我电脑上能跑”的问题。

📦 PICTURE 3 — ONE COMPUTER, SEPARATE PACKAGESतस्वीर 3 — एक COMPUTER, अलग PACKAGES图 3 — 一台电脑,各自独立的包
Virtual environments System PythonSystem Python系统 Python python 3.13.16requests 2.34.2 project A / myproject_envproject A / myproject_env项目 A / myproject_env python 3.13.16requests 2.32.3 project B / envproject B / env项目 B / env python 3.13.16Django 5 · pandas 3 Same computer, three separate sets of packages: upgrading one project cannot break another.वही computer, packages के तीन अलग sets: एक project upgrade करने से दूसरा नहीं टूटता।同一台电脑,三套互相独立的包:升级一个项目不会弄坏另一个。 Real check: the venv has requests 2.32.3, the system has 2.34.2.असली जाँच: venv में requests 2.32.3, system में 2.34.2।实测:venv 中 requests 为 2.32.3,系统中为 2.34.2。
# create the environment (once per project)
python3 -m venv myproject_env          # Windows: py -m venv myproject_env

# activate it
source myproject_env/bin/activate      # macOS / Linux
myproject_env\Scripts\activate          # Windows Command Prompt
.\myproject_env\Scripts\Activate.ps1    # Windows PowerShell

# install packages and record exact versions
pip install requests==2.32.3
pip freeze > requirements.txt

# leave the environment
deactivate
OUTPUT
pip freeze (inside the environment): certifi==2026.10.23 charset-normalizer==3.5.2 idna==3.20 requests==2.32.3 urllib3==2.8.0 requests inside the venv : 2.32.3 requests in system Python: 2.34.2
🎁
Golden Rule — One Project, One Environmentसुनहरा नियम — एक Project, एक Environment黄金法则 —— 一个项目,一个环境

Create the environment before installing anything, and keep requirements.txt with your code. Anyone can then rebuild the same setup with pip install -r requirements.txt. Don't commit the environment folder itself — add it to .gitignore.

कुछ भी install करने से पहले environment बनाएँ, और requirements.txt अपने code के साथ रखें। तब कोई भी pip install -r requirements.txt से वही setup बना सकता है। Environment folder ख़ुद commit न करें — उसे .gitignore में डालें।

安装任何东西之前先创建环境,并把 requirements.txt 和代码放在一起。任何人都能用 pip install -r requirements.txt 重建同样的环境。不要提交环境文件夹本身 —— 把它加入 .gitignore。


SectionSection第 12 节

Your First Complete Program 🧮आपका पहला पूरा Program 🧮你的第一个完整程序 🧮

This calculator uses everything above: functions, if/elif, a loop, user input and error handling. One improvement over the original: instead of returning an error message as if it were a number, calculate() raises an error, and main() catches it — so a result is always a number.

यह calculator ऊपर की सारी चीज़ें इस्तेमाल करता है: functions, if/elif, loop, user input और error handling। मूल से एक सुधार: error message को संख्या की तरह लौटाने की जगह calculate() error raise करता है, और main() उसे पकड़ता है — इसलिए नतीजा हमेशा संख्या होता है।

这个计算器用到了上面所有内容:函数、if/elif、循环、用户输入和错误处理。相比原版的一处改进:calculate() 不再把错误信息当作数字返回,而是抛出错误,由 main() 捕获 —— 这样结果永远是数字。

# calculator.py — a small calculator
def calculate(a, b, op):
    """Return a op b, or raise ValueError for a bad operator."""
    if op == "+":
        return a + b
    elif op == "-":
        return a - b
    elif op == "*":
        return a * b
    elif op == "/":
        if b == 0:
            raise ZeroDivisionError("cannot divide by zero")
        return a / b
    elif op == "**":
        return a ** b
    else:
        raise ValueError(f"unknown operator {op!r}")


def main():
    print("=== Python Calculator ===")
    print("Operators: +  -  *  /  **")
    while True:
        try:
            a = float(input("First number:  "))
            op = input("Operator:      ").strip()
            b = float(input("Second number: "))
            print(f"  {a} {op} {b} = {calculate(a, b, op)}")
        except (ValueError, ZeroDivisionError, OverflowError) as err:
            print(f"  Error: {err}")
        if input("Another? (y/n): ").strip().lower() != "y":
            print("Goodbye!")
            break


if __name__ == "__main__":
    main()
python3 calculator.py
OUTPUT
=== Python Calculator === Operators: + - * / ** First number: 25 Operator: ** Second number: 0.5 25.0 ** 0.5 = 5.0 Another? (y/n): y First number: 7 Operator: / Second number: 0 Error: cannot divide by zero Another? (y/n): y First number: 0.1 Operator: + Second number: 0.2 0.1 + 0.2 = 0.30000000000000004 Another? (y/n): y First number: abc Error: could not convert string to float: 'abc' Another? (y/n): n Goodbye!
LIVELIVE互动Try the CalculatorCalculator आज़माएँ试试计算器

Type two numbers and an operator. The highlighted line is the branch that runs; the output matches what Python prints, float formatting and error messages included.

दो संख्याएँ और एक operator लिखें। Highlighted line वह शाखा है जो चलती है; output ठीक वैसा है जैसा Python छापता है, float formatting और error messages समेत।

输入两个数和一个运算符。高亮的行是实际执行的分支;输出与 Python 打印的完全一致,包括浮点格式和错误信息。


SectionSection第 13 节

Golden Rules for Python Beginners 🏆Python Beginners के सुनहरे नियम 🏆Python 初学者黄金法则 🏆

🐍 7 Rules for Python BeginnersPython Beginners के 7 नियमPython 初学者的 7 条法则
1
Use a current Python 3. Python 2 reached end of life on 1 January 2020. Any recent 3.x (3.12 or newer) is fine for learning.
नया Python 3 इस्तेमाल करें। Python 2 का जीवन 1 January 2020 को ख़त्म हो गया। सीखने के लिए कोई भी हाल का 3.x (3.12 या नया) ठीक है।
使用较新的 Python 3。Python 2 已于 2020 年 1 月 1 日停止支持。学习时任何较新的 3.x(3.12 或更新)都可以。
2
One project, one virtual environment. Create it with python3 -m venv .venv before installing anything.
एक project, एक virtual environment। कुछ भी install करने से पहले python3 -m venv .venv से बनाएँ।
一个项目,一个虚拟环境。安装任何东西前,先用 python3 -m venv .venv 创建。
3
Read the error message. Start at the last line (the error type and message), then look up at the file and line number it points to.
Error message पढ़ें। आख़िरी line (error type और message) से शुरू करें, फिर ऊपर उस file और line number को देखें जिसकी ओर वह इशारा करता है।
阅读错误信息。从最后一行(错误类型和信息)开始看,再往上找它指向的文件和行号。
4
Code a little every day. Programming is a skill: thirty minutes daily beats one long session a week.
रोज़ थोड़ा code करें। Programming एक हुनर है: रोज़ तीस मिनट, हफ़्ते में एक लंबे session से बेहतर है।
每天写一点代码。编程是一门技能:每天三十分钟胜过每周一次长时间练习。
5
Use meaningful names. student_count, not sc. Code is read far more often than it is written.
सार्थक नाम रखें। student_count, sc नहीं। Code लिखे जाने से कहीं ज़्यादा पढ़ा जाता है।
使用有意义的名字。写 student_count,不写 sc。代码被阅读的次数远多于被编写的次数。
6
Follow PEP 8. 4 spaces per indent level, snake_case for variables and functions, PascalCase for classes. Let a tool such as Ruff check it for you.
PEP 8 मानें। हर indent level पर 4 spaces, variables और functions के लिए snake_case, classes के लिए PascalCase। Ruff जैसे tool से जाँच करवाएँ।
遵守 PEP 8。每级缩进 4 个空格,变量和函数用 snake_case,类用 PascalCase。让 Ruff 等工具帮你检查。
7
Look things up. Professionals check the docs (docs.python.org) every day. Understand the ideas; let the docs hold the details.
चीज़ें खोजें। Professionals रोज़ docs (docs.python.org) देखते हैं। विचार समझें; details docs पर छोड़ें।
勤查资料。专业开发者每天都查文档(docs.python.org)。理解概念,细节交给文档。
LIVELIVE互动Quick Checkछोटी जाँच小测验

Five questions on this lesson. Pick an answer to see why.

इस lesson पर पाँच सवाल। जवाब चुनें और कारण देखें।

关于本课的五道题。选择答案查看解释。

🧮
Key Takeawayमुख्य सीख核心要点

A program is a precise recipe, and the computer follows it exactly. Python makes those recipes short and readable: it compiles your whole file to bytecode and then runs it, it is slower than C for raw loops but fast enough for most work (and libraries like NumPy close the gap), and it has a huge ecosystem. Install it, try the REPL, write a .py file, keep each project in its own virtual environment — and write a little code every day.

Program एक सटीक recipe है, और computer उसे ठीक वैसे ही follow करता है। Python इन recipes को छोटा और पढ़ने योग्य बनाता है: यह आपकी पूरी file को bytecode में compile करके चलाता है, सादे loops में C से धीमा है पर ज़्यादातर काम के लिए काफ़ी तेज़ (और NumPy जैसी libraries अंतर भर देती हैं), और इसका ecosystem विशाल है। इसे install करें, REPL आज़माएँ, एक .py file लिखें, हर project को उसके अपने virtual environment में रखें — और रोज़ थोड़ा code लिखें।

程序是一份精确的菜谱,计算机会严格照做。Python 让这些菜谱简短易读:它把整个文件编译成字节码再运行;纯循环比 C 慢,但对大多数工作已足够快(NumPy 等库还能弥补差距);而且生态极其丰富。安装它,试试 REPL,写一个 .py 文件,让每个项目使用自己的虚拟环境 —— 并且每天写一点代码。

🐍 Try Python Yourself

Write, run and visualize Python step by step. No install needed.