Python and Types
- Jino Shaji
- Jan 7, 2015
- 1 min read
Updated: Jun 9, 2020
Python determines the data types in a program automatically. “Dynamic Typing”
But Python’s not casual about types, it enforces them after it figures them out. “Strong Typing”.
So, for example, you can’t just append an integer to a string. You must first convert the integer to a string itself.
x = “the answer is ” # Decides x is string.
y = 23 # Decides y is integer.
print x + y # Python will complain about this.
Comments