saving . . . saved Single quote vs. double quote has been deleted. Single quote vs. double quote has been hidden .
Single quote vs. double quote
Title
Question
I can use single quote in the place of double quote in the title command and it works.  I am using Canopy.  Does this work in all python environments or only in Canopy?

Python Embellishing-a-plot 06-07 min 40-50 sec 25-07-15, 7:37 a.m. kannan

Answers:

<span style="line-height: 21.4285717010498px; background-color: rgb(250, 250, 250);">Dear User,</span>

There is no such difference between other python and Canopy. Canopy is just a Python distribution.

<font face="Helvetica Neue, Helvetica, Arial, sans-serif"><span style="line-height: 19.5px;">There is no difference between using single quotes and double quotes in Python. They can be used interchangeably. As a matter of personal preference you can use any but stick to one of them to avoid confusion. As convention, most of the programmers prefer double quotes for string.</span></font>
<font face="Helvetica Neue, Helvetica, Arial, sans-serif"><span style="line-height: 19.5px;">
</span></font>
<font face="Helvetica Neue, Helvetica, Arial, sans-serif"><span style="line-height: 19.5px;">Hope this helps.</span></font>
<font face="Helvetica Neue, Helvetica, Arial, sans-serif"><span style="line-height: 19.5px;">
</span></font>
<font face="Helvetica Neue, Helvetica, Arial, sans-serif"><span style="line-height: 19.5px;">Thanks.</span></font>
25-07-15, 12:52 p.m. Trupti


Hi Sir,

Single quotes and double quotes have no significant difference.

They can be used as per preference. but, it is good to maintain consistency and not mix both of them in scripts.

Also, if there is some string which contains single quotes in it then it should be written in double quotes so that the single quotes are automatically escaped

Eg. "This is string with 'single quotes' which are escaped automatically"

If the above string js printed it will be
This is string with 'single quotes' which are escaped automatically
26-07-15, 1:59 p.m. hardythe1


Log-in to answer to this question.