---
title: "01 - 什麼是 Python？"
type: note
specialty: Programming
tags: [python, 01-什麼是python]
---

# 01 - 什麼是 Python？

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

---

## 🐍 Python 簡介

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

### 為什麼學 Python？

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

---

## 📥 安裝 Python

### 下載

前往 [python.org](https://www.python.org/downloads/) 下載最新版本（建議 Python 3.10+）。

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

### 確認安裝

```bash
python --version
# Python 3.12.x
```

---

## 🚀 第一支程式

### 用互動式模式（REPL）

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

### 寫成 .py 檔案執行

建立 `hello.py`：

```python
print("Hello, World!")
name = input("你叫什麼名字？")
print(f"你好，{name}！")
```

執行：

```bash
python hello.py
```

---

## 🛠️ 推薦開發環境

| 工具 | 適合對象 | 下載 |
|------|----------|------|
| **VS Code** | 一般開發（推薦） | [code.visualstudio.com](https://code.visualstudio.com) |
| **PyCharm** | 大型專案 | [jetbrains.com](https://www.jetbrains.com/pycharm/) |
| **Jupyter Notebook** | 資料分析 | `pip install jupyter` |

---

## 📌 Python 之禪（The Zen of Python）

```python
import this
```

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

---

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