Hunt 2: Colons and spaces
此页面需较新浏览器(支持 SharedArrayBuffer)。请升级 Chrome、Edge、Firefox 或 Safari 至最新版本。
English
Colons and spaces
- Python uses a colon
:and spaces to see which lines belong together. - One missing colon or two extra spaces, and the program stops.
- Some bugs give no error: the program runs, but does the wrong thing. Run it and compare.
| Word | Meaning |
|---|---|
| indent | spaces at the start of a line |
| block | the indented lines after a : |
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
Your pet is stuck! This program should output jump / jump / jump. Find the bug and fix it.
点击“运行”查看此处输出。
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
Your pet is stuck! This program should output yes. Find the bug and fix it.
点击“运行”查看此处输出。
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
Your pet is stuck! This program should output 2. Find the bug and fix it.
点击“运行”查看此处输出。
难度 2/5 · 今日首次完成可获 140 金币及少量额外奖励
Your pet is stuck! This program should output Purr. Find the bug and fix it.
点击“运行”查看此处输出。
难度 2/5 · 今日首次完成可获 140 金币及少量额外奖励
Your pet is stuck! This program should output 12. Find the bug and fix it.
点击“运行”查看此处输出。