views:

98

answers:

2

Hi i have string

s='This is sample'

i need to convert like this

s='"This is sample"'

output="This is sample"

how to do this in dynamic
Thanks in advance

+6  A: 
orig = 'This is sample'
converted = '"%s"' % orig
jellybean
Thank you so much
Kumar
short simple correct
DrFalk3n
+1  A: 
>>> s= 'This is a sample'
>>> s = '"' + s + '"'  # or s = '"%s"' % s
>>> s
'"This is a sample"'
>>> print(s)
"This is a sample"
>>>
mjv