473,785 Members | 2,327 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Difference between " and '

Hi,

Can someone tell me the difference between single quote and double
quote?

Thanks

Jul 21 '05
21 3018
Andrew Dalke said unto the world upon 2005-07-22 13:30:
François Pinard wrote:
There is no strong reason to use one and avoid the other. Yet, while
representin g strings, Python itself has a _preference_ for single
quotes.

I use "double quoted strings" in almost all cases because I
think it's easier to see than 'single quoted quotes'.

Andrew
da***@dalkescie ntific.com


I prefer the look of '''single triple''' to """double triple""" but a
while back I noticed pydoc doesn't work as well with single triple
quotes. When I posted here, Kent Johnson was kind enough to tease out
of me what I was on about and file a bug:
<http://sourceforge.net/tracker/index.php?func= detail&aid=1185 124&group_id=54 70&atid=105470 >

Best to all,

Brian vdB

Jul 22 '05 #21
On Fri, 22 Jul 2005 08:38:28 -0400, Peter Hansen wrote:
Steven D'Aprano wrote:
It may shock some people to learn that difference in the sense of
mathematical subtraction is not the only meaning of the word, but there
it is. One wouldn't, I hope, misunderstand "What is the difference
between spaghetti marinara and spaghetti pescatora?" and attempt to
subtract one from the other, since subtraction is not defined for
foodstuffs.

>>> sum(ord(c) for c in 'spaghetti marinara') - sum(ord(c) for c in "spaghetti pescatora")
-119

Works for me... ;-)


Yes, but if you had thought about the problem a little longer, you would
have removed the spaghetti from both, since they just cancel each other.
Although that does assume that the commutative law holds for pasta
products.

Personally, I prefer this answer:
import sets
sets.Set("spagh etti marinara") - sets.Set("spagh etti pescatora")

Set(['m', 'n'])

--
Steven.
Jul 23 '05 #22

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
14746
by: Giulio | last post by:
I'm studying Craig Larman's "Applying uml and Patterns" (third ed.) reading at the book it seems (16.6) that Operations and Methods in a Class diagram are something different but it's not explained what's the difference. I always thought they were the same thing. Do someone knows what's the difference? thanx alot Giulio
6
2404
by: XiongBin | last post by:
anybody who tell me: what is the difference between "struct" and "class"? :-)
5
3696
by: Bob | last post by:
Are they different names for the same concept ?
2
10009
by: Keith Smith | last post by:
What is the difference between "build" and "rebuild" when building a project?
5
1573
by: Agnes | last post by:
For my own practices. I like to put "Me". e.g IF Me.txtInvoice.textlength = 0 ....... etc Me.txt.....etc However, Is there any difference (without Me) ?? Thanks
6
71982
by: John Pass | last post by:
What is the difference between a While and Do While/Loop repetition structure. If they is no difference (as it seems) why do both exist?
1
4747
by: tankbattle | last post by:
That is, what's the difference between <complexType name="Address" final="restriction"> <sequence> <element name="name" type="string"/> <element name="street" type="string"/> <element name="city" type="string"/> </sequence> </complexType> and <complexType name="Address" block="restriction">
3
18146
by: Bsr | last post by:
What is the difference between for the following methods. "GET", "HEAD", "PUT" or "POST". Ex:my $req =HTTP::Request->new(GET =>$url1); Bhuvan.
6
4594
by: =?Utf-8?B?SmVmZg==?= | last post by:
I thought this would already be covered here, but my search turned up nothing. In VS2005, if I use "String" to define a new variable/class, it colors it in the Aqua color as it does other classes. But if I use "string", it colors it in Navy blue as in C# reserved words (e.g. private, void, foreach, etc). What is the diff?
4
171475
by: msukumarbabu | last post by:
Hi all, What will be difference between "typedef enum" and "enum". or difference between “typedef structure" and "structure" I am going through some code. in that some place they are using enum without typedef. In some places they are using typedef before enumeration definition. Kindly provide some reference, for why they are using typedef.
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9489
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10162
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10100
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9959
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8988
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5396
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5528
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2893
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.