Files
coding-mentor-agent/kb/python-course-kb-practical-python/wiki/exercises/1-12-a-mystery.md
T

865 B

id, source_exercise_id, title, section, source_path, source_repo, source_commit, student_visible_solution, has_private_solution, skip
id source_exercise_id title section source_path source_repo source_commit student_visible_solution has_private_solution skip
practical-python-1.12 1.12 A Mystery 1.3 Numbers 01_Introduction/03_Numbers.md https://github.com/dabeaz-course/practical-python 93dca856b41c61a0a0f85ae334116e4c125629ea false false false

Exercise 1.12: A Mystery

Source: Practical Python Programming, 01_Introduction/03_Numbers.md.

Exercise 1.12: A Mystery

int() and float() can be used to convert numbers. For example,

>>> int("123")
123
>>> float("1.23")
1.23
>>>

With that in mind, can you explain this behavior?

>>> bool("False")
True
>>>

Contents | Previous (1.2 A First Program) | Next (1.4 Strings)

关联来源