0

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

mjv
75.7k14 gold badges119 silver badges158 bronze badges
asked Dec 9, 2009 at 12:44
0

2 Answers 2

5
orig = 'This is sample'
converted = '"%s"' % orig
answered Dec 9, 2009 at 12:50
Sign up to request clarification or add additional context in comments.

Comments

1
>>> s= 'This is a sample'
>>> s = '"' + s + '"' # or s = '"%s"' % s
>>> s
'"This is a sample"'
>>> print(s)
"This is a sample"
>>>
answered Dec 9, 2009 at 12:52

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.