0
What is difference between writing strings in single or double quotes,or when to use single and double quotes
3 Antworten
+ 2
this works in c++ ..but in python i don't think it's true
@P Sandesh Baliga
+ 2
There's no actual difference other than what Aleksander said - to avoid unnecessary escaping, for example:
print ("That's")
You can concatenate strings written with different types of quotes, like: "abc" + 'def' and it will still work.
The only thing to follow is to use them in pairs - you can't begin a string with an apostrophe and end it with quote or vice versa. They have to match.