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
Post a Comment