0
difference between ' and "
is there a difference between 'Hello' and "Hello"?
4 Answers
+ 5
In Python 'hello' and "hello" both are same.
+ 1
The only diference between two you can enclose
double and single quoted strings. Like:
'a "quoted" cite'
"another 'quoted' cited"
+ 1
In other languages, Chars are presented in 'A' and strings in "A String" .. Python doesn't care either way, but if you intend to move onto other languages after python, it is a good habit to get into.
0
To avoid ambiguity, for example:
print("'I love you.' He said")
print('"I love you."He said')
They are the same.