Help me understand this

ArdPy ardsrk at gmail.com
Tue Jan 30 02:05:37 EST 2007


Hi,

Pls tell me whats going on in the code snippet below:

>>> n = 10
>>> statstr = "N = ",n
>>> type(statstr)                                 #case1
<type 'tuple'>
>>> print statstr
('N = ', 10)
>>> print "N = ",n                               #case 2
N =  10

In the first case the result is printed as a tuple and in the second 
it appears as an ordinary string.




More information about the Python-list mailing list