跳到主要内容
编程入门 — Python, Java, C, SQL & Web

Python 基础

编程的第一步 —— 无需任何基础。

  • python
  • 22 课程
  • 6 projects
  • 15 videos
  • 在浏览器中运行

此设备:完成 0 / 22 门课程

开始课程

每节课均在浏览器中运行——编写真实代码,点击运行,任务自动检查。免费,无需账户,配有与英文对照的翻译笔记。

本课程中的课程

显示 26 / 26 门课程

Part 1 You build: Project: Mad Libs

  1. 先跑起来 这些按钮 · 出错的时候 · 程序等你输入的时候 Lesson 0 · 3 项必做任务 · ★
  2. 你的第一个程序 Show text with print · Strings · Comments Lesson 1 · 3 项必做任务 · ★ 视频
  3. 变量 A box with a name · Make a variable · Naming rules · Change a variable Lesson 2 · 3 项必做任务 · ★ 视频
  4. 数字与运算符 Two kinds of number · Add, subtract, multiply, divide · Whole-number division, remainder, powers · Order of operations Lesson 3 · 3 项必做任务 · ★ 视频
  5. 获取输入 Ask the user with input · When your program waits · input always gives a string · Turn text into a number Lesson 4 · 3 项必做任务 · ★ 视频
  6. 字符串操作 Letters have positions · Take a slice · Length and changing case · f-strings build text Lesson 5 · 4 项必做任务 · ★★ 视频
  7. 项目 Project: Mad Libs Collect the words · Change a word · A title with a line under it 项目 · ★★

Part 2 You build: Project: Guess the number

  1. 做出决策 Making a choice · Comparisons · if / elif / else · The remainder Lesson 6 · 4 项必做任务 · ★★ 视频
  2. 计数循环 Repeat with for · Counting with range · Build a total (accumulator) · Words and a number on one line Lesson 7 · 4 项必做任务 · ★★ 视频
  3. While循环 Loop while a condition is true · Always change the condition · break and continue · Checking before or after Lesson 8 · 3 项必做任务 · ★★ 视频
  4. 项目 Project: Guess the number One guess · Keep guessing · Print the count · The sentence 项目 · ★★★

Part 3 You build: Project: Quiz with a score

  1. Lists (1-D arrays) A list holds many values · Get and change items · Add items and count them · Loop over a list Lesson 9 · 3 项必做任务 · ★★ 视频
  2. 项目 Project: Quiz with a score Two lists that match · Keep the score · Forgive the typing 项目 · ★★★

Part 4 You build: Project: Rock, paper, scissors

  1. 函数 Name a block of code · Give it inputs (parameters) · Send back a result (return) · return vs print Lesson 10 · 3 项必做任务 · ★★ 视频
  2. 项目 Project: Rock, paper, scissors Who wins? · Functions can use functions · Check what the player typed · Play for real 项目 · ★★★

Part 5 You build: Project: Text adventure

  1. 作用域与参数 Local variables · Global variables · Default values · How arguments are passed Lesson 11 · 4 项必做任务 · ★★★ 视频
  2. Dictionaries (records) Store data by name · Get and set values · A dictionary as a record · Check and loop Lesson 12 · 3 项必做任务 · ★★★ 视频
  3. 项目 Project: Text adventure A dictionary inside a dictionary · Is there a door? · Follow a list of directions · Play for real 项目 · ★★★★

Part 6 You build: Project: Hangman

  1. 规划与伪代码 Plan before you code · Decomposition · Abstraction · Structured English Lesson 13 · 3 项必做任务 · ★★ 视频
  2. 错误与测试 Three kinds of error · Syntax errors · Runtime errors · Logic errors Lesson 14 · 3 项必做任务 · ★★★ 视频
  3. 综合应用 The plan · Handy built-ins for lists · A pattern you will reuse: count items that pass a test Lesson 15 · 3 项必做任务 · ★★★ 视频
  4. 项目 Project: Hangman Plan first · Build a string letter by letter · Stop as soon as you know · The game loop 项目 · ★★★★

阅读与资源

  1. Python 简史 Where Python came from · Why the funny name · Built for people to read · Python today 阅读与资源
  2. Python 用来做什么 What people build with Python · Websites and apps · Data, AI, and science · Automation 阅读与资源
  3. 更多学习资源 边玩边练 · 阅读与参考 · 本站更多课程 · 小提示 阅读与资源
  4. 设置你的电脑 Run Python on your own computer · Step 1 — Install Python · Step 2 — Install VS Code · Step 3 — Add the Python extension 阅读与资源
Open the Python reference Every topic in one place, with short examples you can run.

深入学习入口

登录或创建账户

IGCSE, A-Level & AP