difference between ' and " | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

difference between ' and "

is there a difference between 'Hello' and "Hello"?

10th Apr 2017, 8:10 AM
Dion Niessen
Dion Niessen - avatar
4 Answers
+ 5
In Python 'hello' and "hello" both are same.
10th Apr 2017, 8:24 AM
Mr.Robot
Mr.Robot - avatar
+ 1
The only diference between two you can enclose double and single quoted strings. Like: 'a "quoted" cite' "another 'quoted' cited"
10th Apr 2017, 8:45 AM
nextco
nextco - avatar
+ 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.
10th Apr 2017, 9:49 AM
LordHill
LordHill - avatar
0
To avoid ambiguity, for example: print("'I love you.' He said") print('"I love you."He said') They are the same.
10th Apr 2017, 5:40 PM
jackify