+ 2
Why do we need a double quote when we can write texts with a single quote
3 odpowiedzi
+ 4
In python, both single quote and double quote are same and are interchangeable.
But if you are using single quote at beginning then end must also have single quote. Same with double quote.
In other languages like C, C++ and Java the meaning of single quote and double quote is different.
In Java :-
Single Quote means a character
And double quote means a String.
Hope this helps😄
+ 4
It allows you to write:
print("That's what you're dealing with.")
instead of:
print('That\'s what you\'re dealing with.')
+ 1
You can use which you prefer, that's maybe because Python does not have datatype char.
Pythoners typically use single quotes, but I personally use double quotes, so it wouldn't cause any confusion in other programming languages, which only supports " for strings.