Python’s built-in int type represents integers; int(...) is also a constructor that can convert a string containing an integer into an int. This lets you use numeric input in calculations and comparisons instead of treating it as text. section 2.2.2 section 2.2
>>> int("-5")
-5
>>> int("123")
123
The int constructor converts strings representing positive or negative integers. section 2.2.2
Conversion can fail when a string does not represent an integer, raising ValueError. Use try...except to handle potentially invalid input so the exception does not stop the program. section 2.2.2 section 2.2.4
Converting task urgency
A task record such as "Laundry,3" can be split into a title and urgency string, then int(urgency_str) converts the urgency to an integer. If the record contains "3#" instead, conversion raises ValueError. section 12.3
When Python converts JSON numbers, it uses int for integer values and float for real numbers; JSON itself does not distinguish those number types. section 9.3.2














