3 ms·
Python has types. Python 2.7.1 (r271:86832, Apr 22 2011, 16:34:07) [GCC 4.3.2] on linux2 Type "help", "copyright", "credits" or "license" for more
by Goladus 12y ago
Python has types.
Python 2.7.1 (r271:86832, Apr 22 2011, 16:34:07)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> type(5)
<type 'int'>
>>> type('hello world')
<type 'str'>
>>> type({'key': 'value'})
<type 'dict'>
>>> 5 + 'hello world'
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for +: 'int' and 'str'
It just has dynamic typing.