syntax - combining strings using string substitution - python -


hey guys, want perform following operation:

b = 'random'  c = 'stuff'   = '%s' + '%s' %(b, c) 

but following error:

typeerror: not arguments converted during string formatting 

does 1 of know ?

depending on want :

>>> b = 'random' >>> c = 'stuff' >>>  = '%s' %b + '%s' % c >>> 'randomstuff' >>>   >>> b + c 'randomstuff' >>>  >>> z = '%s + %s' % (b, c) >>> z 'random + stuff' >>>  

Comments

Popular posts from this blog

c++ - Compiling static TagLib 1.6.3 libraries for Windows -

php - How can I merge Nodes & Webform Submissions into instances of one general Content Type in Drupal 6? -

xslt - Umbraco and EXSLT sets do not work -