01 - 什麼是 Python?

00-Index | 下一篇 → 02-基本資料型態


🐍 Python 簡介

Python 是一種高階、通用、開源的程式語言,由 Guido van Rossum 於 1991 年創造。

為什麼學 Python?

優點說明
語法簡潔接近英文,容易閱讀和學習
用途廣泛網頁開發、資料分析、AI、自動化、爬蟲
社群龐大全球最多人用的程式語言之一(TIOBE 常年前三)
函式庫豐富pip 上有超過 50 萬個套件
跨平台Windows、Mac、Linux 都能跑

📥 安裝 Python

下載

前往 python.org 下載最新版本(建議 Python 3.10+)。

Windows 安裝時記得勾選 ✅ 「Add Python to PATH」

確認安裝

python --version
# Python 3.12.x

🚀 第一支程式

用互動式模式(REPL)

python
>>> print("Hello, World!")
Hello, World!

寫成 .py 檔案執行

建立 hello.py

print("Hello, World!")
name = input("你叫什麼名字?")
print(f"你好,{name}!")

執行:

python hello.py

🛠️ 推薦開發環境

工具適合對象下載
VS Code一般開發(推薦)code.visualstudio.com
PyCharm大型專案jetbrains.com
Jupyter Notebook資料分析pip install jupyter

📌 Python 之禪(The Zen of Python)

import this

優美勝於醜陋。明確勝於隱晦。簡單勝於複雜。可讀性很重要。


00-Index | 下一篇 → 02-基本資料型態