Is there any difference between " and '?


#1



Is there any difference between " and '?
It seems that these two codes are both corect?

the_string = "Hello"
the_string = 'Hello'


#2

@malvinawang: Almost no difference except stylistically but in case you don't want to escape the quote characters inside your string, use the other type.

string1 = "He turned to me and said, \"Hello there\""
string2 = 'He turned to me and said, "Hello there"'

#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.