+ 1
What is the correct string to be? kept in double quotation marks
2 Answers
+ 11
With Python, the use of ' ' or " " is basicaly the same, and defines strings.
Choosing one over the other allows you to insert the non-chosen quote mark inside the string.
a = "it's a string"
will be fine
a = 'it's a string'
won't
b = 'this is a "quote".'
is ok
b = "this is a "quote"."
is not.
Then, if you need ' and " in your string, you can use triple quotes as in:
c = """it's a "quote" in a string"""
+ 1
First and last must be same . Qoutaion..Inside strings given .. content