dynamic type variable

J. Peng jpeng at block.duxieweb.com
Mon Jan 21 03:37:36 CET 2008


Python's variable is dynamic type,is it?
But why this can't work?

>>> 3 + 'a'
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: unsupported operand type(s) for +: 'int' and 'str'


So I see the number 3 can't be converted to string type automacially.



More information about the Python-list mailing list