← Learn to Code — Python, Java, C, SQL & Web · 编程入门 — Python, Java, C, SQL & Web
Python Practice · Python 练习
Coding challenges from 1★ to 5★. · 1★ 到 5★ 的编程挑战。
python 108 Lessons · 课程
Every lesson runs in your browser — write real code, press Run, and the tasks check themselves. Free, no account needed, with translated notes paired with English. · 每节课均在浏览器中运行——编写真实代码,点击运行,任务自动检查。免费,无需账户,配有与英文对照的翻译笔记。
Lessons in this course · 本课程中的课程
No lessons match. Clear the search or choose another filter. · 没有匹配的课时。请清空搜索或选择其他筛选条件。
- 01 Print a word · 打印一个单词 1 required task · 1 个必做任务 · ★
- 02 Print another word · 再打印一个单词 1 required task · 1 个必做任务 · ★
- 03 Print a sentence · 打印一句话 1 required task · 1 个必做任务 · ★
- 04 Print with a ! · 用感叹号打印 1 required task · 1 个必做任务 · ★
- 05 Print two lines · 打印两行 1 required task · 1 个必做任务 · ★
- 06 Print three lines · 打印三行 1 required task · 1 个必做任务 · ★
- 07 Print a number · 打印一个数字 1 required task · 1 个必做任务 · ★
- 08 Print a bigger number · 打印一个更大的数字 1 required task · 1 个必做任务 · ★
-
09
Add two numbers · 两数相加
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Numbers & operators · 数字与运算符
-
10
Add bigger numbers · 更大的数相加
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Numbers & operators · 数字与运算符
-
11
Subtract · 减法
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Numbers & operators · 数字与运算符
-
12
Multiply · 乘法
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Numbers & operators · 数字与运算符
-
13
Divide · 除法
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Numbers & operators · 数字与运算符
-
14
Remainder · 求余数
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Numbers & operators · 数字与运算符
-
15
Use a variable · 使用变量
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Variables · 变量
-
16
A number variable · 数字变量
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Variables · 变量
-
17
Change a variable · 改变变量
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Variables · 变量
-
18
Add two variables · 变量相加
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Variables · 变量
-
19
Multiply two variables · 变量相乘
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Variables · 变量
-
20
Join two words · 连接两个单词
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Working with strings · 处理字符串
-
21
Greet a name · 问候名字
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Working with strings · 处理字符串
-
22
Repeat text · 重复文字
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Working with strings · 处理字符串
-
23
Ask for a name · 询问名字
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Getting input · 获取输入
-
24
Echo a number · 回显数字
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Getting input · 获取输入
-
105
Call a function · 调用一个函数
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Functions · 函数
-
106
Use what it gives back · 使用它返回的值
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Functions · 函数
-
107
Finish the function · 把函数补完
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Functions · 函数
-
108
Write one yourself · 自己写一个
1 required task · 1 个必做任务
· ★★
Builds on: · 前置课时: Python Basics · Python 基础 · Functions · 函数
-
25
Your first function · 你的第一个函数
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Functions · 函数
-
26
Is it positive? · 是正数吗?
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Functions · 函数
-
27
The bigger one · 较大的那个
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Functions · 函数
-
28
The last item · 最后一项
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Functions · 函数
-
29
Is it even? · 是偶数吗?
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Functions · 函数
-
30
Sum a list · 求列表之和
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Functions · 函数
-
31
Reverse a string · 反转字符串
1 required task · 1 个必做任务
· ★★
Builds on: · 前置课时: Python Basics · Python 基础 · Functions · 函数
-
32
Count the vowels · 数元音字母
1 required task · 1 个必做任务
· ★★
Builds on: · 前置课时: Python Basics · Python 基础 · Functions · 函数
-
33
FizzBuzz
1 required task · 1 个必做任务
· ★★★
Builds on: · 前置课时: Python Basics · Python 基础 · Functions · 函数
-
34
Letter frequencies · 字母频率
1 required task · 1 个必做任务
· ★★★
Builds on: · 前置课时: Python Basics · Python 基础 · Dictionaries (records) · 字典(记录)
-
35
Remove duplicates · 去除重复项
1 required task · 1 个必做任务
· ★★★
Builds on: · 前置课时: Python Basics · Python 基础 · Functions · 函数
-
36
Second largest · 第二大的值
1 required task · 1 个必做任务
· ★★★
Builds on: · 前置课时: Python Basics · Python 基础 · Functions · 函数
-
37
Group anagrams · 变位词分组
1 required task · 1 个必做任务
· ★★★★
Builds on: · 前置课时: Python Basics · Python 基础 · Dictionaries (records) · 字典(记录)
-
38
Flatten a nested list · 展平嵌套列表
1 required task · 1 个必做任务
· ★★★★
Builds on: · 前置课时: Python Basics · Python 基础 · Functions · 函数
-
39
RPN calculator · 逆波兰计算器
1 required task · 1 个必做任务
· ★★★★★
Builds on: · 前置课时: Python Basics · Python 基础 · Functions · 函数
-
40
Run-length encoding · 游程编码
1 required task · 1 个必做任务
· ★★★★★
Builds on: · 前置课时: Python Basics · Python 基础 · Functions · 函数
-
41
Count to ten · 数到十
1 required task · 1 个必做任务
· ★★
Builds on: · 前置课时: Python Basics · Python 基础 · Counting loops · 计数循环
-
42
Even numbers · 偶数
1 required task · 1 个必做任务
· ★★
Builds on: · 前置课时: Python Basics · Python 基础 · Counting loops · 计数循环
-
43
Liftoff · 发射
1 required task · 1 个必做任务
· ★★
Builds on: · 前置课时: Python Basics · Python 基础 · While loops · while 循环
-
44
Star triangle · 星星三角形
1 required task · 1 个必做任务
· ★★
Builds on: · 前置课时: Python Basics · Python 基础 · Counting loops · 计数循环
-
45
The 3 times table · 3 的乘法表
1 required task · 1 个必做任务
· ★★
Builds on: · 前置课时: Python Basics · Python 基础 · Counting loops · 计数循环
-
46
Running total · 累计求和
1 required task · 1 个必做任务
· ★★★
Builds on: · 前置课时: Python Basics · Python 基础 · Lists (1-D arrays) · 列表(一维数组)
-
47
Largest without max · 不用 max 找最大值
1 required task · 1 个必做任务
· ★★★
Builds on: · 前置课时: Python Basics · Python 基础 · Functions · 函数
-
48
Smallest without min · 不用 min 找最小值
1 required task · 1 个必做任务
· ★★★
Builds on: · 前置课时: Python Basics · Python 基础 · Functions · 函数
-
49
Count the positives · 数一数正数
1 required task · 1 个必做任务
· ★★
Builds on: · 前置课时: Python Basics · Python 基础 · Functions · 函数
-
50
Average of a list · 列表的平均数
1 required task · 1 个必做任务
· ★★★
Builds on: · 前置课时: Python Basics · Python 基础 · Functions · 函数
-
51
Add up 1 to 100 · 从 1 加到 100
1 required task · 1 个必做任务
· ★★
Builds on: · 前置课时: Python Basics · Python 基础 · Counting loops · 计数循环
-
52
Upside-down triangle · 倒三角形
1 required task · 1 个必做任务
· ★★
Builds on: · 前置课时: Python Basics · Python 基础 · Counting loops · 计数循环
-
53
FizzBuzz with 4 and 6 · 4 和 6 的 FizzBuzz
1 required task · 1 个必做任务
· ★★★
Builds on: · 前置课时: Python Basics · Python 基础 · Counting loops · 计数循环
-
54
Until you type stop · 直到输入 stop
1 required task · 1 个必做任务
· ★★★
Builds on: · 前置课时: Python Basics · Python 基础 · While loops · while 循环
-
55
A list of squares · 平方数列表
1 required task · 1 个必做任务
· ★★
Builds on: · 前置课时: Python Basics · Python 基础 · Lists (1-D arrays) · 列表(一维数组)
-
56
Count a value · 统计某个值
1 required task · 1 个必做任务
· ★★
Builds on: · 前置课时: Python Basics · Python 基础 · Functions · 函数
-
57
Keep the evens · 只留下偶数
1 required task · 1 个必做任务
· ★★
Builds on: · 前置课时: Python Basics · Python 基础 · Functions · 函数
-
58
Find the position · 找到位置
1 required task · 1 个必做任务
· ★★★
Builds on: · 前置课时: Python Basics · Python 基础 · Functions · 函数
-
59
Smallest and largest · 最小值和最大值
1 required task · 1 个必做任务
· ★★★
Builds on: · 前置课时: Python Basics · Python 基础 · Functions · 函数
-
60
Above average · 高于平均数
1 required task · 1 个必做任务
· ★★★
Builds on: · 前置课时: Python Basics · Python 基础 · Functions · 函数
-
61
Binary to denary · 二进制转十进制
1 required task · 1 个必做任务
· ★★★★
Builds on: · 前置课时: Python Basics · Python 基础 · Functions · 函数
-
62
Denary to binary · 十进制转二进制
1 required task · 1 个必做任务
· ★★★★
Builds on: · 前置课时: Python Basics · Python 基础 · Functions · 函数
-
63
Digital root · 数字根
1 required task · 1 个必做任务
· ★★★★
Builds on: · 前置课时: Python Basics · Python 基础 · Functions · 函数
-
64
Caesar cipher · 凯撒密码
1 required task · 1 个必做任务
· ★★★★
Builds on: · 前置课时: Python Basics · Python 基础 · Functions · 函数
-
65
Bank account · 银行账户
1 required task · 1 个必做任务
· ★★★★
Builds on: · 前置课时: Python Basics · Python 基础 · Functions · 函数
-
66
Transpose a grid · 网格转置
1 required task · 1 个必做任务
· ★★★★
Builds on: · 前置课时: Python Basics · Python 基础 · Functions · 函数
-
67
Most common word · 出现最多的单词
1 required task · 1 个必做任务
· ★★★★★
Builds on: · 前置课时: Python Basics · Python 基础 · Dictionaries (records) · 字典(记录)
-
68
Sieve of Eratosthenes · 埃拉托色尼筛法
1 required task · 1 个必做任务
· ★★★★★
Builds on: · 前置课时: Python Basics · Python 基础 · Functions · 函数
-
69
A row of Pascal's triangle · 杨辉三角的一行
1 required task · 1 个必做任务
· ★★★★★
Builds on: · 前置课时: Python Basics · Python 基础 · Functions · 函数
-
70
Tic-tac-toe winner · 井字棋赢家
1 required task · 1 个必做任务
· ★★★★★
Builds on: · 前置课时: Python Basics · Python 基础 · Functions · 函数
-
71
Is it big? · 够大吗?
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Making decisions · 做出判断
-
72
Pass or fail · 及格还是不及格
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Making decisions · 做出判断
-
73
Positive, negative or zero · 正数、负数还是零
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Making decisions · 做出判断
-
74
The bigger number · 较大的那个数
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Making decisions · 做出判断
-
75
Even or odd · 奇数还是偶数
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Making decisions · 做出判断
-
76
Is it in range? · 在范围内吗?
1 required task · 1 个必做任务
· ★★
Builds on: · 前置课时: Python Basics · Python 基础 · Making decisions · 做出判断
-
77
Free entry · 免费入场
1 required task · 1 个必做任务
· ★★
Builds on: · 前置课时: Python Basics · Python 基础 · Making decisions · 做出判断
-
78
Grade letter · 等第字母
1 required task · 1 个必做任务
· ★★
Builds on: · 前置课时: Python Basics · Python 基础 · Making decisions · 做出判断
-
79
Divisible by both · 能同时整除
1 required task · 1 个必做任务
· ★★
Builds on: · 前置课时: Python Basics · Python 基础 · Making decisions · 做出判断
-
80
Ticket price · 票价
1 required task · 1 个必做任务
· ★★
Builds on: · 前置课时: Python Basics · Python 基础 · Making decisions · 做出判断
-
81
Finish the countdown · 把倒数补完
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Counting loops · 计数循环
-
82
The loop that never ends · 停不下来的循环
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · While loops · while 循环
-
83
Count up to five · 数到五
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · While loops · while 循环
-
84
Add up to five · 加到五
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · While loops · while 循环
-
85
Double until it passes 100 · 翻倍直到超过 100
1 required task · 1 个必做任务
· ★★
Builds on: · 前置课时: Python Basics · Python 基础 · While loops · while 循环
-
86
Stop at the first over fifty · 在第一个超过五十处停下
1 required task · 1 个必做任务
· ★★
Builds on: · 前置课时: Python Basics · Python 基础 · While loops · while 循环
-
87
Count down in twos · 每次减二倒数
1 required task · 1 个必做任务
· ★★
Builds on: · 前置课时: Python Basics · Python 基础 · While loops · while 循环
-
88
Until they type stop · 直到输入 stop
1 required task · 1 个必做任务
· ★★
Builds on: · 前置课时: Python Basics · Python 基础 · While loops · while 循环
-
89
How many halvings? · 要减半几次?
1 required task · 1 个必做任务
· ★★
Builds on: · 前置课时: Python Basics · Python 基础 · While loops · while 循环
-
90
A row of the times table · 乘法表的一行
1 required task · 1 个必做任务
· ★★
Builds on: · 前置课时: Python Basics · Python 基础 · While loops · while 循环
-
91
The first letter · 第一个字母
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Working with strings · 处理字符串
-
92
The last letter · 最后一个字母
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Working with strings · 处理字符串
-
93
The first three letters · 前三个字母
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Working with strings · 处理字符串
-
94
How long is it? · 它有多长?
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Working with strings · 处理字符串
-
95
Shout it · 大声说
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Working with strings · 处理字符串
-
96
Initials · 姓名首字母
1 required task · 1 个必做任务
· ★★
Builds on: · 前置课时: Python Basics · Python 基础 · Working with strings · 处理字符串
-
97
Ask for a name · 问一个名字
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Getting input · 获取输入
-
98
Ask for two things · 问两样东西
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Getting input · 获取输入
-
99
A number from input · 读入一个数
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Getting input · 获取输入
-
100
Add two numbers you were given · 把读入的两个数相加
1 required task · 1 个必做任务
· ★★
Builds on: · 前置课时: Python Basics · Python 基础 · Getting input · 获取输入
-
101
Each letter on its own line · 每个字母一行
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Counting loops · 计数循环
-
102
Zero to four · 从零到四
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Counting loops · 计数循环
-
103
Count the letters · 数字母
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Counting loops · 计数循环
-
104
Add up one to five · 一加到五
1 required task · 1 个必做任务
· ★
Builds on: · 前置课时: Python Basics · Python 基础 · Counting loops · 计数循环