Numbers & Strings
In short: The conversion between numeric values and their text representation — e.g. an entered number that’s initially available as a string and has to be converted into an actually computable number, or vice versa.
In more detail: This conversion is one of the most common sources of error when processing user input: if the entered text doesn’t contain a valid number format (e.g. letters instead of digits), the conversion typically triggers an exception that has to be caught. For the reverse direction (number to text), it’s worth noting that different regions use different formats for the decimal separator (dot vs. comma).
In Depth
input_value = input("Age: ") # ALWAYS comes back as a string, e.g. "25"
age = int(input_value) # explicit conversion string -> number
next_year_age = age + 1 # now it can be calculated withThe central point: user input (from a terminal, a form field, a file) arrives in practically every language initially as plain text — even if the user enters “25”, for the program this is at first just the character sequence "25", not a computable number. Without explicit conversion, "25" + 1 would, depending on the language, either throw an error or (worse) simply append the number 1 to the text ("251") instead of adding it.
This conversion reliably fails if the text isn’t a valid number format:
age = int("twenty-five") # throws an error - not a valid number formatThis is why every conversion of user input into numbers should be guarded with error handling (exception handling), instead of blindly assuming the input is always in the correct format — users mistype, copy wrong values, or deliberately enter nonsensical data.
For the reverse direction (converting a number into text, e.g. for display), a less obvious but equally real trap lurks: the decimal separator. Some regions/languages use a dot (3.14), others a comma (3,14) — if a number is printed as text with the wrong regional format or read back in the wrong way, this leads to subtly wrong values (3,14 could wrongly become 314, if the comma is interpreted as a thousands separator instead of a decimal separator).
See also: Type Casting, String Concatenation, User Input