Hunt 3: Types
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)
Độ khó 2/5 · 140 xu + phần thưởng nhỏ khi hoàn thành lần đầu tiên hôm nay
Your pet is stuck! This program should output Kit is 3 years old. Find the bug and fix it.
Nhấn Chạy để xem kết quả ở đây.
Độ khó 2/5 · 140 xu + phần thưởng nhỏ khi hoàn thành lần đầu tiên hôm nay
Your pet is stuck! This program should output 8. Find the bug and fix it. (The input is 4.)
Nhấn Chạy để xem kết quả ở đây.
Độ khó 2/5 · 140 xu + phần thưởng nhỏ khi hoàn thành lần đầu tiên hôm nay
Your pet is stuck! This program should output Full!. Find the bug and fix it.
Nhấn Chạy để xem kết quả ở đây.
Độ khó 2/5 · 140 xu + phần thưởng nhỏ khi hoàn thành lần đầu tiên hôm nay
Your pet is stuck! This program should output Great!. Find the bug and fix it. (The input is 7.)
Nhấn Chạy để xem kết quả ở đây.
Độ khó 3/5 · 200 xu + phần thưởng nhỏ khi hoàn thành lần đầu tiên hôm nay
Your pet is stuck! This program should output 7.5. Find the bug and fix it.
Nhấn Chạy để xem kết quả ở đây.