Hunt 3: Types
此页面需较新浏览器(支持 SharedArrayBuffer)。请升级 Chrome、Edge、Firefox 或 Safari 至最新版本。
English
Text or number?
"3"is text.3is a number. They look the same when you print them, but they act differently.input()always gives text.
| Word | Meaning |
|---|---|
| type | the kind of value: text (str), whole number (int), decimal (float) |
| convert | change the type: int("4") gives 4 |
print("4" * 2)
print(4 * 2)
难度 2/5 · 今日首次完成可获 140 金币及少量额外奖励
Your pet is stuck! This program should output Kit is 3 years old. Find the bug and fix it.
点击“运行”查看此处输出。
难度 2/5 · 今日首次完成可获 140 金币及少量额外奖励
Your pet is stuck! This program should output 8. Find the bug and fix it. (The input is 4.)
点击“运行”查看此处输出。
难度 2/5 · 今日首次完成可获 140 金币及少量额外奖励
Your pet is stuck! This program should output Full!. Find the bug and fix it.
点击“运行”查看此处输出。
难度 2/5 · 今日首次完成可获 140 金币及少量额外奖励
Your pet is stuck! This program should output Great!. Find the bug and fix it. (The input is 7.)
点击“运行”查看此处输出。
难度 3/5 · 今日首次完成可获 200 金币及少量额外奖励
Your pet is stuck! This program should output 7.5. Find the bug and fix it.
点击“运行”查看此处输出。