what is the difference between>>>>> print('Hello') and print("Hello") | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

what is the difference between>>>>> print('Hello') and print("Hello")

I am moving from Java and just wanted to learn something new during my break

26th Jul 2017, 9:45 PM
Vivan Shah
Vivan Shah - avatar
3 Answers
+ 2
none, well... there is: If you have a word with an apostrophe like I'm in between ('...') then you'll have to write ('I'm') as ('I\'m'). That doesn't apply to double quotes so you can just write ("I'm"). If you have a quotation using single quotes inside of the ('...') then use \' again to denote that it's part of the string If you have a quotation using double quotes inside of ('...') then no problems arise. If you have a quotation using double quotes inside of ("...") then you should instead use ('...') or put \" for each \' denotes that it's an apostrophe and not the end of the string, instead.
26th Jul 2017, 9:51 PM
God Usopp
God Usopp - avatar
+ 1
print("Hello World, I'm God Usopp") print('Hello World, I\'m God Usopp') print('God Usopp said "Hello World" to the world') print("God Usopp said \"Hello World\" to the world") print('God Usopp\'s book \'Hello World\' is divine') print("God Usopp's book 'Hello World' is divine") print('Thanks God Usopp') print("Thanks God Usopp")
26th Jul 2017, 10:12 PM
God Usopp
God Usopp - avatar
- 2
single quotes is more related to single characters, and double quotes for whole strings...
27th Jul 2017, 12:46 AM
CarLoiD
CarLoiD - avatar