+ 1
What is diffrence between these two? Is it important?
Type "d",'d' It gives: ('d', 'd') But "d"+'d' Gives 'dd'
3 Answers
+ 1
I'd say that their only difference is, that you necessarily need to escape double quotes in double quote strings, and single quotes in single quote strings.
" ' " Valid
" " " Invalid
" \" " Valid
" \' " Valid
' " ' Valid
' ' ' Invalid
' \' ' Valid
' \" ' Valid
+ 5
This is a contact of strings, they are glued together if in quotes.
0
In Python, you can choose freely between ' and " - it both turns out as str.