0

What is difference between writing strings in single or double quotes,or when to use single and double quotes

8th Dec 2016, 6:16 AM
Ashish Ranjan
Ashish Ranjan - avatar
3 Antworten
+ 2
this works in c++ ..but in python i don't think it's true @P Sandesh Baliga
8th Dec 2016, 6:40 AM
Ashish Ranjan
Ashish Ranjan - avatar
+ 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.
10th Dec 2016, 12:08 AM
Kuba Siekierzyński
Kuba Siekierzyński - avatar