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

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

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