
November 15th, 2012, 08:26 AM
|
 |
Contributing User
|
|
|
|
object type is so important that when debugging I examine type before value.
Python refuses:
'string '+98
Assuming you want 'string 98', some alternatives:
Code:
#(recent pythons)
'string {}'.format(98)
'string {0:d}'.format(98)
'string{0:3d}'.format(98)
'string {3:d}'.format('a','bc',2,98,'x')
# all the pythons I've used accept
'string '+str(98)
'string %d'%(98) # ''%TUPLE deprecated
__________________
[code] Code tags[/code] are essential for python code!
|