+ 1
What's the difference between ' and " in Python?
For example, output of print('hello') and print("hello") is the same.
5 Réponses
+ 12
In python you can define a string using ether. They will both work.
+ 10
Some languages make you think twice about what their inventors were high on while putting together their craft.
Python is weird (especially if learnt after C, C++ and Java).
+ 6
There is no technical difference between them. However, "The cat's furry tail." is a valid string, as well as 'He said "Hello!" before leaving.'.
So if you want to save yourself some headaches and escapes, use the appropriate one. Good rule of thumb is to use double quotes whenever you have a string, that might be displayed to the user.
+ 6
You understood, good.
Just for your knowledge in most os the other languages ' c ' is used for characters (char type means single value) and "c" is string.
0
I understood. thanks. XD