+ 2
What is difference between double quotes and single quote?
7 odpowiedzi
+ 5
In python, there is no set difference, and its just a matter of convenience at the developer's end that he/she chooses double or single quotes. One may use double quotes when the strings include apostrophes.
Eg :
print("You can't use single quotes in between single quotes without escaping...");
Now, if you used single quotes, you would need to escape the quote in between, with a single backslash character.
Eg :
print('You can\'t use single quotes in between single quotes without escaping...');
For more information, read here :
https://stackoverflow.com/questions/56011/single-quotes-vs-double-quotes-in-python
+ 11
In C++, single quotes are used for a single character while double quotes is used for a string. Example:
char c = 't' //It's a single character
string s = "Hello" //It's a word
+ 3
This is heavily dependent on the language as some just consider all strings to be strings, others consider double quotes a string and single quotes characters, and others will not interpret expressions in single quotes but will do so for double quotes.
+ 2
In which language?
+ 2
+ 2
usually single quotes are used for one character. Double quotes are used for strings of characters.
+ 2
variables dont work inside single quotes in php