Languages

Python - single or double quotes for strings?

0 points
Asked by:
Mark-Rotteveel
537

Should I use single or double quotes for string variables in Python?

1 answer
0 points
Answered by:
Paluskitten
356

Both the ways are correct. 

Use single quotes for string literals, e.g. 'single-quotes',  but for strings that are likely to contain single-quote characters use double quotes e.g "You're awesome!".

0 commentsAdd comment
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join