Question About Running Python code

Ian Kelly ian.g.kelly at gmail.com
Thu Oct 16 03:31:31 CEST 2014


On Oct 15, 2014 7:04 PM, "Cameron Simpson" <cs at zip.com.au> wrote:
>
> On 15Oct2014 16:09, Dan Stromberg <drsalists at gmail.com> wrote:
>>
>> On Wed, Oct 15, 2014 at 3:50 PM, ryguy7272 <ryanshuell at gmail.com> wrote:
>>>
>>> #1)  That's very bizarre to mix single quotes and double quotes in a
single      language.  Does Python actually mix single quotes and double
quotes?
>>
>>
>> I'm not sure what you mean by "mix".  C uses single quotes and double
>> quotes, right?
>
>
> Yes, but it uses single quotes for characters (a single byte integer
type) and double quotes for strings. Python doesn't really have a single
character type, and lets the user use either quote mark as they see fit.
Ryan finds this unfamiliar.

In any case, it's hardly bizarre; it's common among interpreted languages.
Other languages that allow both single- and double-quote strings include
ECMAScript and Lua. Perl, PHP and Ruby also have both variants but
distinguish between them for interpolation.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20141015/8fa9555f/attachment.html>


More information about the Python-list mailing list