0
Whats the use of "" and difference between ' ' in print statement?
3 Antworten
+ 5
"this is a string"
'this is another string'
https://www.sololearn.com/Discuss/446544/?ref=app
+ 2
There's no difference.
They can be used when you want a quotation marks in the string.
If we want to take this sentence as string
He said, "Your answer is right!".
Then we will use single quotation marks because the double quotation marks are used in the sentence
x = ' He said, "Your answer is right" '
And if I want to take the word That's as a string then we can use double quotation marks as single quotation mark is in the word
y = " That's "
You can also do this without using two types of quotation marks by using \.
y = ' That\'s '
0
Thx dear