+ 4
Difference between ' and " ?
so these tutorials I'm going through seem to use ' and " (single and double quotes) interchangeably when dealing with strings. I know there is a difference in C, but does it matter for Python? if it was explained anywhere, I missed it. Thanks!
6 Respuestas
+ 17
Nope, no difference. You may use them alternatively, if you need to enclose an apostrophe or quotes and don't want to escape them.
So both:
print("Let's go!")
and
print('She said: "Go away!" and left.')
will be fine.
+ 4
definitely noooooo difference!!! but if you wanna print sth in python you can use ' in the text if you used " for the text definition...
+ 3
" / ' = 2 😉
+ 2
If you use one, you can output the other without a backslash, there isn't another differences I think
0
' and " are interchangeable in Python, both can be use without giving an error