0
In Python v.3.x, what better to use for string ' or '' (quotes or double quotes )?
3 Respuestas
+ 4
It doesn't matter: the only difference is what quotes needs to be escaped ^^
Else, you can use triple quotes (simple or double), which provide also possibility to write multilines string (not mandatory to escape new line characters ;))
+ 1
it's only up to you, i use double quotes just because i'm used to, but for instance, if i need to use double quotes inside a string, it's confortable using single quotes to delimitate it.
exemple:
string=' Mark says:"Hello, how are you?" ' #Here i use single quotes to delimiate the string because i use double quotes inside the string...
0
Thank you for reply!
By the way for eliminating quotes, you could use "\"
example:
string=' Mark says:\"Hello, how are you?\" '