H13-311_V3.5 · Question #218
The time interval in the Python language is a Hoating-point fraction in seconds
The correct answer is A. True. A (True) is correct because Python's time module represents time intervals as floating-point numbers in seconds, allowing sub-second precision. For example, time.sleep(0.5) sleeps for half a second, and time.time() returns something like 1691234567.891234 - a float. This design…
Question
The time interval in the Python language is a Hoating-point fraction in seconds
Options
- ATrue
- BFalse
How the community answered
(32 responses)- A78% (25)
- B22% (7)
Explanation
A (True) is correct because Python's time module represents time intervals as floating-point numbers in seconds, allowing sub-second precision. For example, time.sleep(0.5) sleeps for half a second, and time.time() returns something like 1691234567.891234 - a float. This design gives Python fine-grained control over timing without needing separate units for milliseconds or microseconds.
B (False) is wrong because Python does not use integers or a special duration type for time intervals by default - floats are the standard representation across time.sleep(), time.time(), and related functions.
Memory tip: Think of Python's time as a "decimal clock" - the whole number is seconds, and the decimal part is the fraction of a second, just like how 0.5 means half a second.
Topics
Community Discussion
No community discussion yet for this question.