Why its double quoted "Hi" | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why its double quoted "Hi"

while explaining print('Hello World!')... single quote was used

22nd Dec 2017, 4:25 PM
Bhaskar Deb
Bhaskar Deb - avatar
4 Answers
+ 3
in python both single and double quote represent string as there is no such concept of char, but in other languages single quote represent char and double quote a string. There is also triple quote for multi line string (triple quote is treated as multi line comments if it is not assigned to any variable.).
22nd Dec 2017, 5:50 PM
techytushar
techytushar - avatar
+ 2
They're all the same. Use to tell the parser that is is a string. The only difference is one is a single quote and the other a double quote. :-)
22nd Dec 2017, 5:05 PM
Gerald Akorli
Gerald Akorli - avatar
0
gottcha
22nd Dec 2017, 5:06 PM
Bhaskar Deb
Bhaskar Deb - avatar
0
because Python is the coolest coding of all. All quotes are equal here bro
3rd Jul 2018, 12:25 AM
Subhajit Ghosh
Subhajit Ghosh - avatar